Results 1 to 4 of 4
  1. #1
    liriarte is offline Member
    Join Date
    Feb 2014
    Location
    London
    Posts
    2
    Rep Power
    0

    Default Maven copies 3 jars in lib folder (skinny war) for no reason

    I have one EAR project and I am trying to have a skinny war. It seems to be working ok but for some reason it keeps copying 3 dependencies into war/lib folder, which are commons-logging-1.0.4.jar, commons-codec-1.4.jar and jboss-seam-2.2.1.Final.jar.

    I the EAR's pom I added `<skinnyWars>true</skinnyWars>`. I made sure I added exclusions for those three jars, or they are `scope=provided`. I also added `<packagingExcludes>**/*.jar</packagingExcludes>` in the WAR's pom file.

    I really can't understand maven's logic to create the war (or to copy those jars).

    1) When I run maven only for the WAR project, the WAR has no jars in /lib folder

    2) But when I run maven for all the projects (including the EAR) it copies those 3 jars in the war file.

    What am I doing wrong? Why is different the WAR created with maven inside the WAR project then for all projects (including EAR)? Please help

    This is the dependency tree for the WAR project (only seam jar is there, but provided):

    Java Code:
     [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ xs ---
        [INFO] fuseim:xs:war:3.1.1
        [INFO] +- fuseim:xs-common:jar:3.1.1:provided
        [INFO] |  +- commons-codec:commons-codec:jar:1.5:provided
        [INFO] |  +- hibernate-annotations:hibernate-annotations:jar:3.2.1.GA:provided
        [INFO] |  +- org.bouncycastle:bcprov-jdk15:jar:1.45:provided
        [INFO] |  +- org.bouncycastle:bcpg-jdk15:jar:1.45:provided
        [INFO] |  +- org.apache.lucene:lucene-core:jar:2.3.0:provided
        [INFO] |  \- org.apache.tika:tika-parsers:jar:1.0:provided
        [INFO] |     +- org.apache.tika:tika-core:jar:1.0:provided
        [INFO] |     +- edu.ucar:netcdf:jar:4.2-min:provided
        [INFO] |     +- org.apache.james:apache-mime4j-core:jar:0.7:provided
        [INFO] |     +- org.apache.james:apache-mime4j-dom:jar:0.7:provided
        [INFO] |     +- org.apache.commons:commons-compress:jar:1.3:provided
        [INFO] |     +- org.apache.pdfbox:pdfbox:jar:1.6.0:provided
        [INFO] |     |  +- org.apache.pdfbox:fontbox:jar:1.6.0:provided
        [INFO] |     |  \- org.apache.pdfbox:jempbox:jar:1.6.0:provided
        [INFO] |     +- org.bouncycastle:bcmail-jdk15:jar:1.45:provided
        [INFO] |     +- org.apache.poi:poi:jar:3.8-beta4:provided
        [INFO] |     +- org.apache.poi:poi-scratchpad:jar:3.8-beta4:provided
        [INFO] |     +- org.apache.poi:poi-ooxml:jar:3.8-beta4:provided
        [INFO] |     |  +- org.apache.poi:poi-ooxml-schemas:jar:3.8-beta4:provided
        [INFO] |     |  |  \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:provided
        [INFO] |     |  \- dom4j:dom4j:jar:1.6.1:provided
        [INFO] |     +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:provided
        [INFO] |     +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:provided
        [INFO] |     +- asm:asm:jar:3.1:provided
        [INFO] |     +- com.drewnoakes:metadata-extractor:jar:2.4.0-beta-1:provided
        [INFO] |     \- de.l3s.boilerpipe:boilerpipe:jar:1.1.0:provided
        [INFO] +- fuseim:xs-remasa:jar:3.1.1:provided
        [INFO] +- fuseim:xs-connectors:jar:3.1.1:provided
        [INFO] |  +- fuseim:xs-commonservice:jar:3.1.1:provided
        [INFO] |  |  +- com.openspirit:openspirit:jar:3.2.0.270:provided
        [INFO] |  |  +- org.geotoolkit:geotk-bundle-referencing:jar:3.1.2:provided
        [INFO] |  |  +- org.hdfgroup:hdf-java:jar:2.6.1:provided
        [INFO] |  |  \- commons-net:commons-net:jar:3.1:provided
        [INFO] |  +- org.jboss.seam:jboss-seam:jar:2.2.1.Final:provided
        [INFO] |  +- com_lgc_ph_common:com_lgc_ph_common:jar:1.0:provided
        [INFO] |  \- com_lgc_ph_client:com_lgc_ph_client:jar:1.0:provided
        [INFO] +- fuseim:xs-jwitsml:jar:3.1.1:provided
        [INFO] |  +- org.apache.axis:axis:jar:1.4:provided
        [INFO] |  +- javax.xml:jaxrpc-api:jar:1.1:provided
        [INFO] |  \- jdom:jdom:jar:1.0:provided
        [INFO] +- fuseim:xs-studio:jar:3.1.1:provided
        [INFO] |  \- org.apache.poi:poi-contrib:jar:3.7-beta3:provided
        [INFO] +- fuseim:xs-ui:jar:3.1.1:provided
        [INFO] |  +- org.antlr.stringtemplate:stringtemplate:jar:1.0:provided
        [INFO] |  +- commons-lang:commons-lang:jar:2.3:provided
        [INFO] |  +- edu.mines.jtk:edu_mines_jtk:jar:1.1:provided
        [INFO] |  +- org.jbpm:jbpm-jpdl:jar:3.2.3:provided
        [INFO] |  \- jfree:jcommon:jar:1.0.12:provided
        [INFO] +- fuseim:xs-viewers:jar:3.1.1:provided
        [INFO] |  \- net.sf.json-lib:json-lib:jar:1.1:provided
        [INFO] +- fuseim:xs-work:jar:3.1.1:provided
        [INFO] |  +- org.antlr:antlr-runtime:jar:3.3:provided
        [INFO] |  |  \- org.antlr:stringtemplate:jar:3.2.1:provided
        [INFO] |  |     \- antlr:antlr:jar:2.7.7:provided
        [INFO] |  +- commons-discovery:commons-discovery:jar:0.2:provided
        [INFO] |  +- org.drools:drools-api:jar:5.0.1:provided
        [INFO] |  +- org.drools:drools-compiler:jar:5.0.1:provided
        [INFO] |  |  +- org.eclipse.jdt:core:jar:3.4.2.v_883_R34x:provided
        [INFO] |  |  +- janino:janino:jar:2.5.15:provided
        [INFO] |  |  \- org.mvel:mvel2:jar:2.0.10:provided
        [INFO] |  +- org.drools:drools-core:jar:5.0.1:provided
        [INFO] |  |  \- joda-time:joda-time:jar:1.6:provided
        [INFO] |  +- org.drools:drools-decisiontables:jar:5.0.1:provided
        [INFO] |  |  \- jexcelapi:jxl:jar:2.4.2:provided
        [INFO] |  +- org.drools:drools-templates:jar:5.0.1:provided
        [INFO] |  +- net.sf.ezmorph:ezmorph:jar:1.0.6:provided
        [INFO] |  +- org.jboss.el:jboss-el:jar:1.0_02.CR2:provided
        [INFO] |  +- com.uwyn:jhighlight:jar:1.0:provided
        [INFO] |  +- redis.clients:jredis:jar:1.0-rc1:provided
        [INFO] |  +- rome:rome-fetcher:jar:0.9:provided
        [INFO] |  +- rome:rome:jar:0.9:provided
        [INFO] |  +- org.klomp:snark:jar:1.0:provided
        [INFO] |  +- org.eclipse.jgit:org.eclipse.jgit:jar:1.3.0.201202151440-r:provided
        [INFO] |  |  \- com.jcraft:jsch:jar:0.1.44-1:provided
        [INFO] |  +- org.jboss.seam:jboss-seam-resteasy:jar:2.2.1.Final:provided
        [INFO] |  +- org.jboss.resteasy:resteasy-jaxrs:jar:2.2.1.GA:provided
        [INFO] |  |  +- org.scannotation:scannotation:jar:1.0.3:provided
        [INFO] |  |  |  \- javassist:javassist:jar:3.12.1.GA:provided
        [INFO] |  |  +- javax.annotation:jsr250-api:jar:1.0:provided
        [INFO] |  |  +- javax.activation:activation:jar:1.1:provided
        [INFO] |  |  \- net.jcip:jcip-annotations:jar:1.0:provided
        [INFO] |  \- com.verhas:license3j:jar:1.0.4:provided
        [INFO] |     \- org.bouncycastle:bcpg-jdk16:jar:1.46:provided
        [INFO] |        \- org.bouncycastle:bcprov-jdk16:jar:1.46:provided
        [INFO] +- plugin:plugin:jar:2.0:compile
        [INFO] +- org.jboss.seam:jboss-seam:ejb:2.2.1.Final:provided
        [INFO] +- commons-digester:commons-digester:jar:1.8:compile
        [INFO] +- com.lowagie:itext:jar:2.1.5:compile
        [INFO] +- com.lowagie:itext-rtf:jar:2.1.4:compile
        [INFO] +- org.jboss.seam:jboss-seam-debug:jar:2.2.1.Final:runtime
        [INFO] +- org.jboss.seam:jboss-seam-excel:jar:2.2.1.Final:runtime
        [INFO] +- org.jboss.seam:jboss-seam-ioc:jar:2.2.1.Final:runtime
        [INFO] +- org.jboss.seam:jboss-seam-mail:jar:2.2.1.Final:runtime
        [INFO] +- org.jboss.seam:jboss-seam-pdf:jar:2.2.1.Final:compile
        [INFO] +- org.jboss.seam:jboss-seam-remoting:jar:2.2.1.Final:runtime
        [INFO] +- org.jboss.seam:jboss-seam-ui:jar:2.2.1.Final:compile
        [INFO] +- com.sun.facelets:jsf-facelets:jar:1.1.15.B1:compile
        [INFO] +- net.sourceforge.jexcelapi:jxl:jar:2.6:compile
        [INFO] +- org.richfaces.impl:richfaces-impl:jar:3.3.1.A.fuse:compile
        [INFO] +- org.richfaces.ui:richfaces-ui:jar:3.3.1.GA:compile
        [INFO] +- net.java.dev.urlrewrite:urlrewritefilter:jar:3.0.4:provided
        [INFO] +- javax.servlet:servlet-api:jar:2.4:provided
        [INFO] +- javax.servlet:jsp-api:jar:2.0:provided
        [INFO] +- org.hibernate:ejb3-persistence:jar:3.0:provided
        [INFO] +- javax.el:el-api:jar:4.2.3.GA:provided
        [INFO] +- commons-beanutils:commons-beanutils:jar:1.6:provided (scope not updated to compile)
        [INFO] |  \- commons-collections:commons-collections:jar:2.0:provided
        [INFO] +- jfreechart:jfreechart:jar:1.0.fuse:provided
        [INFO] +- jivesoftware:smack:jar:3.1.0:compile
        [INFO] +- jivesoftware:smackx:jar:3.1.0:compile
        [INFO] +- org.jboss.resteasy:resteasy-oauth:jar:1.2.GA:compile
        [INFO] |  \- org.slf4j:slf4j-api:jar:1.5.8:compile
        [INFO] +- net.oauth.core:oauth:jar:20100527:compile
        [INFO] +- net.oauth.core:oauth-provider:jar:20100527:compile
        [INFO] +- org.apache.httpcomponents:httpclient:jar:4.1.2:compile
        [INFO] |  \- org.apache.httpcomponents:httpcore:jar:4.1.2:compile
        [INFO] +- org.apache.httpcomponents:httpmime:jar:4.1.1:compile
        [INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
        [INFO] +- org.jboss.resteasy:jaxrs-api:jar:2.2.1.GA:compile
        [INFO] +- commons-fileupload:commons-fileupload:jar:1.3:compile
        [INFO] +- commons-io:commons-io:jar:2.4:compile
        [INFO] +- com.vividsolutions:jts:jar:1.13:compile
        [INFO] +- junit:junit:jar:4.11:compile
        [INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
        [INFO] +- dbunit:dbunit:jar:2.1:compile
        [INFO] \- log4j:log4j:jar:1.2.8:provided
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESS
        [INFO] ------------------------------------------------------------------------
    This is the WAR project's pom:

    Java Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
        <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        	<modelVersion>4.0.0</modelVersion>
        	<name>xs</name>
        	<groupId>fi</groupId>
        	<artifactId>xs</artifactId>
        	<version>3.1.1</version>
        	<description>XS 3</description>
        	<parent>
        		<artifactId>xs-all</artifactId>
        		<groupId>fi</groupId>
        		<version>3</version>
        	</parent>
        
        	<dependencies>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-common</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>org.apache.commons</artifactId>
        					<groupId>commons-codec</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-commonservice</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>org.jboss.seam</artifactId>
        					<groupId>jboss-seam</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-remasa</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-connectors</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>xpp3_min</artifactId>
        					<groupId>xpp3</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>org.jboss.seam</artifactId>
        					<groupId>jboss-seam</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-jwitsml</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-studio</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-ui</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-viewers</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>commons-beanutils</artifactId>
        					<groupId>commons-beanutils</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>commons-logging</artifactId>
        					<groupId>commons-logging</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>fi</groupId>
        			<artifactId>xs-work</artifactId>
        			<version>3.1.1</version>
        			<scope>provided</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>commons-beanutils</artifactId>
        					<groupId>commons-beanutils</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>commons-logging</artifactId>
        					<groupId>commons-logging</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>commons-collections</artifactId>
        					<groupId>commons-collections</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>richfaces-api</artifactId>
        					<groupId>org.richfaces.framework</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>org.jboss.el</artifactId>
        					<groupId>jboss-el</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>plugin</groupId>
        			<artifactId>plugin</artifactId>
        			<version>2.0</version>
        			<type>jar</type>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.seam</groupId>
        			<artifactId>jboss-seam</artifactId>
        			<version>2.2.1.Final</version>
        			<scope>provided</scope>
        			<type>ejb</type>
        			<exclusions>
        				<exclusion>
        					<artifactId>xpp3_min</artifactId>
        					<groupId>xpp3</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>xstream</artifactId>
        					<groupId>xstream</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>commons-digester</groupId>
        			<artifactId>commons-digester</artifactId>
        			<version>1.8</version>
        			<scope>${jbossLibrary.scope}</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>avalon-framework</artifactId>
        					<groupId>avalon-framework</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>commons-logging</artifactId>
        					<groupId>commons-logging</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>com.lowagie</groupId>
        			<artifactId>itext</artifactId>
        			<version>2.1.5</version>
        			<scope>${jbossLibrary.scope}</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>bcmail-jdk14</artifactId>
        					<groupId>bouncycastle</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>bcprov-jdk14</artifactId>
        					<groupId>bouncycastle</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>com.lowagie</groupId>
        			<artifactId>itext-rtf</artifactId>
        			<version>2.1.4</version>
        			<scope>${jbossLibrary.scope}</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>bcmail-jdk14</artifactId>
        					<groupId>bouncycastle</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>bcprov-jdk14</artifactId>
        					<groupId>bouncycastle</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.seam</groupId>
        			<artifactId>jboss-seam-debug</artifactId>
        			<version>2.2.1.Final</version>
        			<scope>${jbossRuntimeLibrary.scope}</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>org.jboss.seam</artifactId>
        					<groupId>jboss-seam</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>org.jboss.el</artifactId>
        					<groupId>jboss-el</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.seam</groupId>
        			<artifactId>jboss-seam-excel</artifactId>
        			<version>2.2.1.Final</version>
        			<scope>${jbossRuntimeLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.seam</groupId>
        			<artifactId>jboss-seam-ioc</artifactId>
        			<version>2.2.1.Final</version>
        			<scope>${jbossRuntimeLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.seam</groupId>
        			<artifactId>jboss-seam-mail</artifactId>
        			<version>2.2.1.Final</version>
        			<scope>${jbossRuntimeLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.seam</groupId>
        			<artifactId>jboss-seam-pdf</artifactId>
        			<version>2.2.1.Final</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.seam</groupId>
        			<artifactId>jboss-seam-remoting</artifactId>
        			<version>2.2.1.Final</version>
        			<scope>${jbossRuntimeLibrary.scope}</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>dom4j</artifactId>
        					<groupId>dom4j</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.seam</groupId>
        			<artifactId>jboss-seam-ui</artifactId>
        			<version>2.2.1.Final</version>
        			<scope>${jbossLibrary.scope}</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>commons-beanutils</artifactId>
        					<groupId>commons-beanutils</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>com.sun.facelets</groupId>
        			<artifactId>jsf-facelets</artifactId>
        			<version>1.1.15.B1</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>net.sourceforge.jexcelapi</groupId>
        			<artifactId>jxl</artifactId>
        			<version>2.6</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.richfaces.impl</groupId>
        			<artifactId>richfaces-impl</artifactId>
        			<version>3.3.1.A.fuse</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.richfaces.ui</groupId>
        			<artifactId>richfaces-ui</artifactId>
        			<version>3.3.1.GA</version>
        			<scope>${jbossLibrary.scope}</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>commons-logging</artifactId>
        					<groupId>commons-logging</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>richfaces-api</artifactId>
        					<groupId>org.richfaces.framework</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>richfaces-impl</artifactId>
        					<groupId>org.richfaces.framework</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>net.java.dev.urlrewrite</groupId>
        			<artifactId>urlrewritefilter</artifactId>
        			<version>3.0.4</version>
        			<scope>provided</scope>
        		</dependency>
        		<!-- This library is provided by Web Container. -->
        		<dependency>
        			<groupId>javax.servlet</groupId>
        			<artifactId>servlet-api</artifactId>
        			<version>2.4</version>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>javax.servlet</groupId>
        			<artifactId>jsp-api</artifactId>
        			<version>2.0</version>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.hibernate</groupId>
        			<artifactId>ejb3-persistence</artifactId>
        			<version>3.0</version>
        			<type>jar</type>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>javax.el</groupId>
        			<artifactId>el-api</artifactId>
        			<version>4.2.3.GA</version>
        			<type>jar</type>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>commons-beanutils</groupId>
        			<artifactId>commons-beanutils</artifactId>
        			<version>1.6</version>
        			<type>jar</type>
        			<scope>provided</scope>
        			<exclusions>
        				<exclusion>
        					<artifactId>commons-logging</artifactId>
        					<groupId>commons-logging</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>jfreechart</groupId>
        			<artifactId>jfreechart</artifactId>
        			<version>1.0.fuse</version>
        			<type>jar</type>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>jivesoftware</groupId>
        			<artifactId>smack</artifactId>
        			<version>3.1.0</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>jivesoftware</groupId>
        			<artifactId>smackx</artifactId>
        			<version>3.1.0</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.resteasy</groupId>
        			<artifactId>resteasy-oauth</artifactId>
        			<version>1.2.GA</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>net.oauth.core</groupId>
        			<artifactId>oauth</artifactId>
        			<version>20100527</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>net.oauth.core</groupId>
        			<artifactId>oauth-provider</artifactId>
        			<version>20100527</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        		<dependency>
        			<groupId>org.apache.httpcomponents</groupId>
        			<artifactId>httpclient</artifactId>
        			<version>4.1.2</version>
        			<type>jar</type>
        			<exclusions>
        				<exclusion>
        					<artifactId>commons-logging</artifactId>
        					<groupId>commons-logging</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>commons-codec</artifactId>
        					<groupId>commons-codec</groupId>
        				</exclusion>
        				<exclusion>
        					<artifactId>org.apache.commons</artifactId>
        					<groupId>commons-codec</groupId>
        				</exclusion>
        			</exclusions>
        		</dependency>
        		<dependency>
        			<groupId>org.apache.httpcomponents</groupId>
        			<artifactId>httpmime</artifactId>
        			<version>4.1.1</version>
        			<type>jar</type>
        		</dependency>
        		<dependency>
        			<groupId>org.jboss.resteasy</groupId>
        			<artifactId>jaxrs-api</artifactId>
        			<version>2.2.1.GA</version>
        			<scope>${jbossLibrary.scope}</scope>
        		</dependency>
        
        		<dependency>
        			<groupId>commons-fileupload</groupId>
        			<artifactId>commons-fileupload</artifactId>
        			<version>1.3</version>
        		</dependency>
        		<dependency>
        			<groupId>commons-io</groupId>
        			<artifactId>commons-io</artifactId>
        			<version>2.4</version>
        		</dependency>
        		<dependency>
        			<groupId>com.vividsolutions</groupId>
        			<artifactId>jts</artifactId>
        			<version>1.13</version>
        		</dependency>
        	</dependencies>
        
        	<!-- Build Settings -->
        	<packaging>war</packaging>
        	<build>
        		<outputDirectory>${basedir}/WebContent/WEB-INF/classes</outputDirectory>
        		<plugins>
        			<plugin>
        				<groupId>org.apache.maven.plugins</groupId>
        				<artifactId>maven-war-plugin</artifactId>
        				<version>2.4</version>
        				<configuration>
        					<!-- Specify the location of Web Application directory (if non-standard). -->
        					<!-- Defailt is: ${basedir}/src/main/webapp -->
        					<warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
        					<archive>
        						<manifestFile>${basedir}/WebContent/META-INF/MANIFEST.MF</manifestFile>
        						<!--<manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix>
        							</manifest> -->
        					</archive>
        					<useCache>false</useCache>
        					<packagingExcludes>**/*.jar</packagingExcludes>
        				</configuration>
        				<executions>
        					<execution>
        						<id>prepare-war</id>
        						<phase>prepare-package</phase>
        						<goals>
        							<goal>exploded</goal>
        						</goals>
        					</execution>
        				</executions>
        			</plugin>
        			<plugin>
        				<groupId>org.apache.maven.plugins</groupId>
        				<artifactId>maven-eclipse-plugin</artifactId>
        				<version>2.8</version>
        				<configuration>
        					<buildcommands>
        						<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
        						<buildcommand>org.eclipse.wst.jsdt.core.javascriptvalidator
        						</buildcommand>
        						<buildcommand>org.eclipse.wst.common.project.facet.core.builder
        						</buildcommand>
        						<buildcommand>org.eclipse.wst.validation.validationbuilder
        						</buildcommand>
        						<buildcommand>org.jboss.tools.seam.core.seambuilder</buildcommand>
        						<buildcommand>org.hibernate.eclipse.console.hibernateBuilder
        						</buildcommand>
        						<buildcommand>org.jboss.tools.jst.web.kb.kbbuilder</buildcommand>
        					</buildcommands>
        
        					<additionalProjectnatures>
        						<projectnature>org.eclipse.jdt.core.javanature</projectnature>
        						<projectnature>org.eclipse.jem.workbench.JavaEMFNature
        						</projectnature>
        						<projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature
        						</projectnature>
        						<projectnature>org.eclipse.wst.common.project.facet.core.nature
        						</projectnature>
        						<projectnature>org.eclipse.wst.jsdt.core.jsNature</projectnature>
        						<projectnature>org.jboss.tools.seam.core.seamnature
        						</projectnature>
        						<projectnature>org.hibernate.eclipse.console.hibernateNature
        						</projectnature>
        						<projectnature>org.jboss.tools.jsf.jsfnature</projectnature>
        						<projectnature>org.jboss.jst.web.kb.kbnature</projectnature>
        					</additionalProjectnatures>
        
        					<classpathContainers>
        						<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
        						</classpathContainer>
        						<classpathContainer>org.eclipse.jst.j2ee.internal.web.container
        						</classpathContainer>
        						<classpathContainer>org.eclipse.jst.j2ee.internal.module.container
        						</classpathContainer>
        						<!-- <classpathContainer>org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/xstreamlineapp</classpathContainer> -->
        					</classpathContainers>
        
        				</configuration>
        			</plugin>
        			<plugin>
        				<groupId>com.google.code.maven-replacer-plugin</groupId>
        				<artifactId>maven-replacer-plugin</artifactId>
        				<version>1.3.7</version>
        				<executions>
        					<execution>
        						<phase>prepare-package</phase>
        						<goals>
        							<goal>replace</goal>
        						</goals>
        					</execution>
        				</executions>
        				<configuration>
        					<file>target/${project.artifactId}-${project.version}/WEB-INF/xstreamline-site.xml
        					</file>
        					<replacements>
        						<replacement>
        							<token>ear.version</token>
        							<value>${ear.version}</value>
        						</replacement>
        						<replacement>
        							<token>ear.time</token>
        							<value>${maven.build.timestamp}</value>
        						</replacement>
        						<!-- This replacement only works from Hudson -->
        						<replacement>
        							<token>build.number</token>
        							<value>${build.number}</value>
        						</replacement>
        					</replacements>
        				</configuration>
        			</plugin>
        		</plugins>
        	</build>
        
        	<reporting>
        		<plugins>
        			<plugin>
        				<groupId>org.apache.maven.plugins</groupId>
        				<artifactId>maven-project-info-reports-plugin</artifactId>
        				<version>2.1.1</version>
        			</plugin>
        			<plugin>
        				<groupId>org.apache.maven.plugins</groupId>
        				<artifactId>maven-javadoc-plugin</artifactId>
        				<version>2.7</version>
        			</plugin>
        		</plugins>
        	</reporting>
        
        </project>

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,758
    Rep Power
    5

    Default Re: Maven copies 3 jars in lib folder (skinny war) for no reason

    The key seems to be the ear creation then, since that is what you add when you build "the entire project". Did you add all dependencies to the EAR project as specified in the documentation on the skinnywar functionality?

    https://maven.apache.org/plugins/mav...inny-wars.html

    Note: I don't really see a purpose to this functionality myself; if you have to define all the dependencies in the ear anyway you might as well just make them all provided in the war so they don't end up in there guaranteed. The fact that the manifest.mf starts to have a purpose just makes me itch all over.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    liriarte is offline Member
    Join Date
    Feb 2014
    Location
    London
    Posts
    2
    Rep Power
    0

    Default Re: Maven copies 3 jars in lib folder (skinny war) for no reason

    Yes I added them all. There is a trick to not add the dependencies twice (see below), but I don't see why it is copying those dependencies at all. Even if I add those dependencies as provided, they end up in the lib folder. It does not make sense to me, I would like to understand the logic to decide to copy a file or not.

    What I'd like to know is:

    1) If those jars are not in the dependency tree at all. Why is maven copying them?

    2) Why the war is different when packaging the WAR project than when packaging the EAR project? Why would the EAR pom decide what goes inside the lib folder of the WAR?


    Java Code:
     <dependencies>   
    <dependency>
          <groupId>...</groupId>
          <artifactId>war-example</artifactId>
          <version>1.0.0</version>
          <type>war</type>
        </dependency>
        <dependency>
          <groupId>...</groupId>
          <artifactId>war-example</artifactId>
          <type>pom</type> <!-- Here works the magic -->
          <version>1.0.0</version>
        </dependency>
      </dependencies>

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,758
    Rep Power
    5

    Default Re: Maven copies 3 jars in lib folder (skinny war) for no reason

    I don't know. I don't use tricks to manage my dependencies, I just properly use scopes and the occasional exclusion and it all works out just fine for me. Probably not many people use this functionality, so perhaps you even found a bug in the war plugin.
    Last edited by gimbal2; 02-28-2014 at 11:04 AM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Replies: 1
    Last Post: Yesterday, 09:14 PM
  2. Replies: 0
    Last Post: 12-30-2013, 07:01 AM
  3. Replies: 0
    Last Post: 08-19-2008, 04:44 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •