Build jGuard with maven 2
since 1.0 series, jGuard use maven 2. you have to download the latest maven 2 archive, install it, and create a MAVEN_HOME variable. this variable need to be referenced too in your operation system PATH.system variables required
- a M2_REPO variable pointing to your maven 2 repository need also to be created.
- a JAVA_4_HOME variable is needed pointing to your jdk 4(1.4) home
- a JAVA_5_HOME variable is needed pointing to your jdk 5(1.5) home
define the settings.xml
jguard needs to use a java 4 and a java 5 compiler to build its sources. to bound the variable defined in the related pom.xml files, you have to insert into your maven2 settings.xml(located into your ~/.m2 directory) file the corrresponding variables.<?xml version="1.0" encoding="UTF-8"?> <settings> <servers> <server> <id>jGuard-stable</id> <username>diabolo512</username> <password>mypwd</password> </server> <server> <id>sourceforge</id> <username>diabolo512</username> <password>mypwd</password> </server> </servers> <profiles> <profile> <id>default</id> <properties> <JAVA_4_HOME>/usr/lib/jvm/j2sdk1.4.2_13-32bits</JAVA_4_HOME> <JAVA_5_HOME>/usr/lib/jvm/jdk1.5.0_10</JAVA_5_HOME> </properties> </profile> </profiles> <activeProfiles> <activeProfile>default</activeProfile> </activeProfiles> </settings>
mvn -version
Maven version: 2.0.4
Install jGuard
to build jguard with tests, simply execute on project jguard:mvn install
mvn install -Dmaven.test.skip=truemvn install -Pdistribution
how it works under the hood
jGuard declare some dependencies in its maven2 configuration files: so, maven2 will look into its local repository. if it does not found the required jar, it tries to download automatically the related jar from remote repositories. if it succeed, it imports it into the local repository. more details on maven2 at http://maven.apache.org/ you can also download freely a great pdf book on maven 2 provided by mergere, and written by vincent massol and jason van zyl: http://www.mergere.com/m2book_download.jspRun tests
to run tests on jguard projects, runmvn test
mvn -Dsurefire.useFile=false testtest jguard-swing-example
mvn exec:exec -e
test wars on jetty application server
mvn org.mortbay.jetty:maven-jetty-plugin:run
activate traces
maven 2 can generate more trace for a better understanding of what's under the hood. to activate trace, you can add to your maven 2 command the -e parameter.mvn -e install
Release jGuard bundle for sourceforge purpose
to create a new release of jguard, runmvn -Duser.name="Builder name" assembly:assembly -Pdistribution
mvn -Duser.name="Builder name" assembly:assembly -Ddescriptor=src/main/assembly/distribution-all.xml
Create jGuard bundle for maven repository purpose
to release jGuard on a maven repository, we need to create an upload bundle with this command:mvn -Duser.name="Builder name" source:jar javadoc:jar repository:bundle-create
Install some libraries directly in your local repository
sometimes, you cannot grab libraries from remote repositories, for legal reasons. you can directly install libraries on your local repository with this command:mvn install:install-file -DgroupId=~~yourGroupId~~ -DartifactId=~~yourArtifactId~~ -Dversion=~~yourVersion~~ -Dpackaging=jar -Dfile=~~path/to/your/file~~
generate an html output of the docbook documentation
mvn -e docbkx:generate-html
generate the pdf output of the docbook documentation
mvn -e docbkx:generate-pdf
build the related maven site
mvn site
deploy the artifacts of the release on our remote repository
mvn deploy
mvn deploy -Dusername=yourSourceforgeUserName -Dpassword=yourSourceforgePassword
deploy the site on sourceforge
mvn site:deploy
Version 3.1 last modified by Charles Gay on 31/07/2008 at 15:46
Document data
Attachments:
No attachments for this document
Comments: 0