Ma-ven E-clipse integration

 

Setup Eclipse development environment

=====================================

For Eclipse IDE for Java Developers 3.4

 

- Start eclipse with options "-vm <JDK 5 PATH>/bin/javaw" (not JRE PATH)

 

 

- Setup maven plugin (please refer to http://www.sonatype.com/book/reference/eclipse.html for details)

 

Copy the maven configuration file <project home>/settings.xml to <USER_HOME>/.m2 (e.g. C:\Documents and Settings\<userId>\.m2\)

Go to Windows>Preferences...

Select General>Network Connectionsa

Enable "Manual proxy configuration"

Set the HTTP proxy to "webproxy........com"

Set the proxy port to 8080

Go to Help>Software Updates

Select "Available Software" tab

Select "Add site..."

Type in "http://m2eclipse.sonatype.org/update/" in location box

Expand the item "Maven Integration for Eclipse Update Site"

Select "Maven Embedder" and "Maven Integration for Eclipse (Required)"

Select "Install..." and then "Finish"

Restart Eclipse

Go to Window>PerferencesSelect "Maven>Installations"

Set "User Settings File" to the <USER_HOME>/.m2/settings.xml- Create an Eclipse java project

Select "New>Java Project..."

 

Select the project in Package explorer

Right click and select "Maven>Update Dependencies"

The project should be built automatically. Please make sure that "Project>Build automatically" is on.

==================================================================

 

 

Maven build (full developement build)

=====================================

mvn clean

mvn -Pdev -Dmaven.test.skip=true assembly:assembly

(A zip file is generated in target folder.)

 

There are different maven profiles for different target environment (e.g. dev, uat and hkprod).

 

Maven build (jar only)

======================

mvn clean

mvn -Pdev -Dmaven.test.skip=true package

(A jar file is generated in target folder.)

==================================================================

 

 

Deploy dependent jar files to our private maven repository

============================================

If the project depends on a new commercial jar file, it is necessary to add the jar file to our private maven respository (http://.....com:8080/maven2_repositories/) such that it is available to other developers.

 

If the dependent jar file is from open source project, it should be available at maven public repository (http://repo1.maven.org/maven2/). Thus, it is not required to be in our private maven repository.

 

The command to deploy a jar file to our private respoistory is as follow.

 

mvn deploy:deploy-file -DgroupId=<group id> -DartifactId=<artifact id>

-Dversion=<version> -Dpackaging=jar -Dfile=<path to jar file>

-Durl=file:/usr/tom/ci/ci-root/maven2_repositories

 

 

For instance, we are going to deploy tibrvj.jar (from RV 8.0) to our private repository.

- Copy the tibrvj.jar to ....com:/tmp

- Login remote server

- Execute the following command

mvn deploy:deploy-file -DgroupId=com.tibco.tibrv -DartifactId=tibrvj

-Dversion=8.0 -Dpackaging=jar -Dfile=/tmp/tibrvj.jar

-Durl=file:/usr/tom/ci/ci-root/maven2_repositories

 

 

 

你可能感兴趣的:(eclipse,maven,xml,ide,Go)