- Install the standard JDK from Oracle. http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Java 8 required (as of Jan. 2017) on VM's where the server is to be deployed as KnetMinder code has been migrated to Java 1.8.
(at time of writing Eclipse-Kepler)
-
Download “Eclipse IDE for Java Developers” (http://www.eclipse.org/downloads)
-
Unpack the zip file (creating D:\eclipse).
-
Open D:\eclipse\eclipse.ini
-
Before the –vmargs line, add the following -vm PATH_TO_JDK\bin\javaw.exe
-
Save and Start D:\eclipse\eclipse.exe
-
Set your workspace, e.g. D:\WorkspaceGit
- Start Eclipse.
- Go to Workbench.
- Open Perspective on the top right bar.
- Select Git Repository Exploring.
- Clone a Git repository.
- Add https://github.com/Rothamsted/knetminer.git as the URI
- Enter Git User name and password
- Set your Local Destination Directory
- Finish
- File -> Import -> Maven Project -> Existing maven Project
- Click "Browse" and select the folder KnetMiner within the git directory selected in the step number 4
- In Advanced, Name template select [artifactId]
- Finish
- To the pom.xml file for each project you would like to deploy, a new plugin must be defined:
<plugins>
...
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://my_tomcat_server:8080/manager</url>
<server>myserver</server>
<path>/${project.build.finalName}</path>
</configuration>
</plugin>
...
</plugins>
Where <url>
contains the address to the tomcat management page of the server you wish to deploy to.
And <path>
is the path on the tomcat server to which the war file is deployed.
- Next each tomcat server with a different username and password needs an entry in the maven settings.xml file.
<settings>
...
<servers>
<server>
<id>myserver</id>
<username>user...</username>
<password>pass...</password>
</server>
</servers>
...
</settings>
Make sure the value for <id>
matches the value inside the <server>
tags in the previous section.
Fill in the username and password fields with those used to login to the tomcat management pages.
- Finally to deploy from eclipse, create a new run configuration with the base directory set to the project you wish to deploy, and for the goals use
tomcat6:redeploy
. This should now compile the project if it needs to and then deploy the generated war file to the specified server.