-
Notifications
You must be signed in to change notification settings - Fork 0
Maven
E. Lynette Rayle edited this page Feb 18, 2022
·
4 revisions
NOTE: Described steps are for Eclipse.
- Edit pom.xml
- Set Packaging to either jar or war
- Save pom.xml
- Rt click pom.xml
- Select Run as... -> Maven Install
- Look in target directory for *.jar or *.war
- Rt click pom.xml -> Run as -> Maven install
- Rt click pom.xml -> Run as -> Maven build
- Select package (May need to select something else. Not exactly sure why package is the right thing to select. Got this info from Matt.)
- Navigate to Eclipse working directory
- Rt Click -> SVN Checkout...
- Use ... browse button for URL of repository to select project to checkout.
- Click OK
- File -> Import...
- Select Maven -> Existing Maven Projects
- Browse... to project in Eclipse working directory
- select trunk
- OK
- Finish
- The jar was created by Maven in another project with the following
<groupId>edu.cornell.clo</groupId>
<artifactId>messageQueue</artifactId>
<version>0.4.1</version>
<packaging>jar</packaging>
- create repo directory just off the project base directory
- for each jar to be accessed locally
- add directories for each level of the groupID (ex.
/repo
/edu/cornell/clo/) - add jar name (aka artifactId) without the version (ex.
/repo/edu/cornell/clo
/messageQueue) - add directory for the version of the jar (ex.
/repo/edu/cornell/clo/messageQueue
**/0.4.1) - put the jar in that directory (ex.
/repo/edu/cornell/clo/messageQueue/0.4.1
/messageQueue-0.4.1.jar)
- add directories for each level of the groupID (ex.
- define the local repository
<repositories>
<repository>
<id>data-local</id>
<name>data</name>
<url>file://${project.basedir}/repo</url>
</repository>
</repositories>
``
* add the dependency on the local jar
From our example above, this would be...
<dependency>
<groupId>edu.cornell.clo</groupId>
<artifactId>messageQueue</artifactId>
<version>0.4.1</version>
</dependency>
- Follow instructions above for Run all steps of Maven