This page (revision-15) was last changed on 23-Apr-2022 17:06 by Harry Metske

This page was created on 23-Apr-2022 17:05 by Harry Metske

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
15 23-Apr-2022 17:06 8 KB Harry Metske to previous
14 23-Apr-2022 17:05 8 KB Harry Metske to previous | to last
13 23-Apr-2022 17:05 8 KB Harry Metske to previous | to last
12 23-Apr-2022 17:05 8 KB Harry Metske to previous | to last
11 23-Apr-2022 17:05 7 KB Harry Metske to previous | to last
10 23-Apr-2022 17:05 7 KB Harry Metske to previous | to last
9 23-Apr-2022 17:05 7 KB Harry Metske to previous | to last
8 23-Apr-2022 17:05 7 KB Harry Metske to previous | to last
7 23-Apr-2022 17:05 7 KB Harry Metske to previous | to last
6 23-Apr-2022 17:05 7 KB Harry Metske to previous | to last
5 23-Apr-2022 17:05 6 KB Harry Metske to previous | to last
4 23-Apr-2022 17:05 6 KB Harry Metske to previous | to last
3 23-Apr-2022 17:05 3 KB Harry Metske to previous | to last
2 23-Apr-2022 17:05 3 KB Harry Metske to previous | to last
1 23-Apr-2022 17:05 2 KB Harry Metske to last

Page References

Incoming links Outgoing links
Maven...nobody

Version management

Difference between version and

At line 10 changed one line
* [Dependency mechanism|http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies]
* [Dependency mechanism|http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html]
At line 13 added 4 lines
* [maven repository|http://mvnrepository.com/] %%small for searching dependency defs :-) %%
* [How_to_find_dependencies|http://maven.apache.org/general.html#How_to_find_dependencies]
* [Maven Eclipse integration|http://www.devx.com/Java/Article/36785/1954]
* [Sonatype online Maven books|http://www.sonatype.com/books/maven-book/]
At line 16 changed one line
I installed the Eclipse QE plugin by adding [http://q4e.googlecode.com/svn/trunk/updatesite-iam/] to the list of software sites and check the Core features plus the Eclipse IAM editor
%%strike I installed the Eclipse QE plugin by adding [http://q4e.googlecode.com/svn/trunk/updatesite-iam/] to the list of software sites and check the Core features plus the Eclipse IAM editor/%
At line 22 added 10 lines
Better: the m2 maven eclipse integration plugin from [http://m2eclipse.sonatype.org/sites/m2e] .
And also the m2e wtp integration from [http://m2eclipse.sonatype.org/sites/m2e-extras/]
Some problems with Eclipse Helios to integrate Eclipse with maven (I want the maven dependencies to be on the webapps classpath when running them in tomcat from within eclipse).
Steps :
* Create new Dynamic Web Project
* Right-click project => Maven => Enable Dependencies
* Right-click project => Properties => Deployment Assembly => Add Java Build libraries => Maven classpath container
At line 64 changed one line
metskem@gneisenau:~$ mvn install:install-file -Dfile=/home/metskem/java_libs/com.ibm.ws.admin.client_7.0.0.jar -DgroupId=com.ibm.websphere -DartifactId=admin.client -Dversion=7.0.0 -Dpackaging=jar -DgeneratePom=true
metskem@gneisenau:~$ mvn install:install-file -Dfile=/home/metskem/java_libs/com.ibm.ws.admin.client_7.0.0.jar -DgroupId=com.ibm.websphere \
-DartifactId=admin.client -Dversion=7.0.0 -Dpackaging=jar -DgeneratePom=true
At line 98 added 4 lines
The same was done for __stripesstuff__ :
%%small
{{mvn install:install-file -Dfile=/home/metskem/java_libs/stripesstuff-0.2.jar -DgroupId=net.sourceforge.stripes -DartifactId=stripesstuff -Dversion=0.2 -Dpackaging=jar -DgeneratePom=true}}
%%
At line 86 changed one line
I had to add the webXml attribute to specify the location of the web.xml file, this can be done in the pom.xml, see the following snippet:\\
I had to add the __webXml__ and __containerConfigXML__ attributes to specify the location of the web.xml and context.xml (Tomcat) file, and also the __warName__ attribute, this can be done in the pom.xml, see the following snippet:\\
At line 117 added 2 lines
<containerConfigXML>WebContent/META-INF/context.xml</containerConfigXML>
<warName>WebTest</warName>
At line 123 added 103 lines
The war file then contains the following :
%%small
{{{
metskem@gneisenau:~/workspace/WebTest$ mvn war:war
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building WebTest
[INFO] task-segment: [war:war]
[INFO] ------------------------------------------------------------------------
[INFO] [war:war {execution: default-cli}]
[INFO] Exploding webapp...
[INFO] Copy webapp webResources to /home/metskem/workspace/WebTest/target/WebTest-1.0-SNAPSHOT
[INFO] Assembling webapp WebTest in /home/metskem/workspace/WebTest/target/WebTest-1.0-SNAPSHOT
[INFO] Generating war /home/metskem/workspace/WebTest/target/WebTest-1.0-SNAPSHOT.war
[INFO] Building war: /home/metskem/workspace/WebTest/target/WebTest-1.0-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sat Oct 02 14:35:42 CEST 2010
[INFO] Final Memory: 4M/53M
[INFO] ------------------------------------------------------------------------
metskem@gneisenau:~/workspace/WebTest$ jar -tf target/WebTest-1.0-SNAPSHOT.war
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/lib/
WEB-INF/classes/
WEB-INF/classes/nl/
WEB-INF/classes/nl/rabobank/
WEB-INF/classes/nl/rabobank/hdw/
WEB-INF/classes/nl/rabobank/hdw/util/
WEB-INF/classes/nl/rabobank/hdw/servlets/
META-INF/context.xml
WEB-INF/lib/commons-logging-1.1.jar
WEB-INF/lib/log4j-1.2.12.jar
WEB-INF/lib/avalon-framework-4.1.3.jar
WEB-INF/lib/logkit-1.0.1.jar
WEB-INF/classes/.mavenResources.target.classes
WEB-INF/classes/nl/rabobank/hdw/util/RaboURLReader.class
WEB-INF/classes/nl/rabobank/hdw/util/Util.class
WEB-INF/classes/nl/rabobank/hdw/util/RaboRasMessage.class
WEB-INF/classes/nl/rabobank/hdw/servlets/LogTestServlet.class
WEB-INF/classes/nl/rabobank/hdw/servlets/SSLTestServlet.class
WEB-INF/classes/nl/rabobank/hdw/servlets/IvpServlet.class
WEB-INF/web.xml
META-INF/maven/
META-INF/maven/computerhok.nl/
META-INF/maven/computerhok.nl/WebTest/
META-INF/maven/computerhok.nl/WebTest/pom.xml
META-INF/maven/computerhok.nl/WebTest/pom.properties
}}}
%%
!! JAR Bloat ?!
It appears that maven dependency includes more jars than when you build your war the traditional way (manually importing jars into WEB-INF/lib, only those you need).\\
See the following differences :
__traditional way__
{{{
tomcat@kruimelhost:/usr/local/tomcat/webapps$ jar -tf krm2.war |grep lib|sort
WEB-INF/jsp/taglibs.jsp
WEB-INF/lib/
WEB-INF/lib/commons-beanutils-1.8.2.jar
WEB-INF/lib/commons-collections-3.2.1.jar
WEB-INF/lib/commons-lang-2.3.jar
WEB-INF/lib/commons-logging-1.1.1.jar
WEB-INF/lib/displaytag-1.2.jar
WEB-INF/lib/itext-1.3.jar
WEB-INF/lib/log4j-1.2.16.jar
WEB-INF/lib/mail.jar
WEB-INF/lib/stripes.jar
WEB-INF/lib/stripesstuff-0.2.jar
}}}
__maven way__
{{{
metskem@gneisenau:~/workspace/krm2$ jar -tf target/krm2.war |grep lib|sort
WEB-INF/lib/
WEB-INF/lib/activation-1.1.jar
WEB-INF/lib/commons-beanutils-1.7.0.jar
WEB-INF/lib/commons-collections-3.1.jar
WEB-INF/lib/commons-lang-2.4.jar
WEB-INF/lib/commons-logging-1.0.jar
WEB-INF/lib/displaytag-1.2.jar
WEB-INF/lib/itext-1.3.jar
WEB-INF/lib/jcl104-over-slf4j-1.4.2.jar
WEB-INF/lib/log4j-1.2.12.jar
WEB-INF/lib/mail-1.4.jar
WEB-INF/lib/slf4j-api-1.4.2.jar
WEB-INF/lib/slf4j-log4j12-1.4.2.jar
WEB-INF/lib/stripes-1.5.2.jar
WEB-INF/lib/stripesstuff-0.2.jar
}}}
It does appear that switching to lower versions of dependencies, you get less jars that are required.
At least you can now see the dependency tree :
[krm2-maven-dependency.png]