You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by nitinaggarwal <ni...@fmr.com> on 2007/06/21 13:51:56 UTC

Issue in excluding unwanted jars from the target war.

Hi 

I am pretty new to maven 2.
i am working on a portal (jsr 168 portlets) project on jetspeed 2.1 portal
server and building using maven2.05.

when i use the mvn install command 
the build is fine and i am successfully able to generate a fcapps.war file.

Everything seems working fine but the problem occurs when i try to deploy
this war on jetspeed 2.1
The fcapps.war file contains all the jars which i do not intend to use. 

when i try to run the application it gives me an error that application
fcapps not available 
and 
only when i delete the unnecessary jars i am able to run the application
properly this seems pretty wierd can any one help.



i only need these 7 jars to deploy my application 
 
commons-logging-1.0.3.jar
ehcache-1.2.4.jar
fcCaching-1.0.jar
fcCmStub-1.0.jar
fcpf-1.0.jar
jdom-1.0.jar
log4j-1.2.8.jar

i am attaching the pom.xml file for my project. 




<!-- author Nitin Aggarwal 
Project Object model for fidelity central application-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>FidelityCentral</groupId>
<artifactId>application</artifactId>
<version>1.0</version>
</parent>
<artifactId>fcapps</artifactId>
<packaging>war</packaging>
<name>Fidelity Central</name>
<description>Fidelity Central Portlets</description>
<version>1.0</version>
<build>
	<sourceDirectory>src/java</sourceDirectory>
	<defaultGoal>install</defaultGoal>
	<pluginManagement>    
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<warSourceDirectory>src/webapp</warSourceDirectory>
				</configuration>
			</plugin> 
		</plugins>
	</pluginManagement>
 			<resources>
			<resource>
				<directory>target/fc</directory>
					<includes>
						<include>fc.war</include>
					</includes>
					<excludes>
						<exclude>**.*</exclude>
					</excludes>
			</resource>
			</resources>
</build>
<dependencies>
	   <dependency>
			<groupId>org.apache.portals.bridges</groupId>
			<artifactId>portals-bridges-common</artifactId>
			<version>1.0.1-dev</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jdom</groupId>
			<artifactId>jdom</artifactId>
			<version>1.0</version>
		</dependency>
		<dependency>
			<groupId>FidelityCentral</groupId>
			<artifactId>fcCmStub</artifactId>
			<version>1.0</version>
		</dependency>
<!--		<dependency>
			<groupId>FidelityCentral</groupId>
			<artifactId>fc-auth</artifactId>
			<version>1.0</version>
		</dependency>-->
		<dependency>
			<groupId>FidelityCentral</groupId>
			<artifactId>fcCaching</artifactId>
			<version>1.0</version>
		</dependency>
		<dependency>
			<groupId>FidelityCentral</groupId>
			<artifactId>fcpf</artifactId>
			<version>1.0</version>
		</dependency>	
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.3</version>
			<scope>provided</scope>
		</dependency>
	    <dependency>
             <groupId>portlet-api</groupId>	
             <artifactId>portlet-api</artifactId>
             <version>1.0</version>
			 <scope>provided</scope>
       </dependency>
		<dependency>
			  <groupId>org.apache.pluto</groupId>
			  <artifactId>pluto</artifactId>
			  <version>1.0.1</version>
			  <scope>provided</scope>
  		</dependency>
	   <dependency>
	         <groupId>org.apache.portals.jetspeed-2</groupId>
             <artifactId>jetspeed-api</artifactId>
			 <version>2.1-dev</version>
			 <scope>provided</scope>
       </dependency>	
  </dependencies>	

</project> http://www.nabble.com/file/p11231529/pom.xml pom.xml 
 

  
-- 
View this message in context: http://www.nabble.com/Issue-in-excluding-unwanted-jars-from-the-target-war.-tf3958240s177.html#a11231529
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Issue in excluding unwanted jars from the target war.

Posted by "Alok, Niraj" <ni...@gs.com>.
Use the scope tag to decide which jars to be packaged. Scope can be
etiher test/compile/runtime/provided. 
Niraj
 

-----Original Message-----
From: nitinaggarwal [mailto:nitin.fbsi.aggarwal@fmr.com] 
Sent: Thursday, June 21, 2007 5:22 PM
To: users@maven.apache.org
Subject: Issue in excluding unwanted jars from the target war.


Hi 

I am pretty new to maven 2.
i am working on a portal (jsr 168 portlets) project on jetspeed 2.1
portal
server and building using maven2.05.

when i use the mvn install command 
the build is fine and i am successfully able to generate a fcapps.war
file.

Everything seems working fine but the problem occurs when i try to
deploy
this war on jetspeed 2.1
The fcapps.war file contains all the jars which i do not intend to use. 

when i try to run the application it gives me an error that application
fcapps not available 
and 
only when i delete the unnecessary jars i am able to run the application
properly this seems pretty wierd can any one help.



i only need these 7 jars to deploy my application 
 
commons-logging-1.0.3.jar
ehcache-1.2.4.jar
fcCaching-1.0.jar
fcCmStub-1.0.jar
fcpf-1.0.jar
jdom-1.0.jar
log4j-1.2.8.jar

i am attaching the pom.xml file for my project. 




<!-- author Nitin Aggarwal 
Project Object model for fidelity central application-->
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>FidelityCentral</groupId>
<artifactId>application</artifactId>
<version>1.0</version>
</parent>
<artifactId>fcapps</artifactId>
<packaging>war</packaging>
<name>Fidelity Central</name>
<description>Fidelity Central Portlets</description>
<version>1.0</version>
<build>
	<sourceDirectory>src/java</sourceDirectory>
	<defaultGoal>install</defaultGoal>
	<pluginManagement>    
		<plugins>
			<plugin>
	
<groupId>org.apache.maven.plugins</groupId>
	
<artifactId>maven-war-plugin</artifactId>
				<configuration>
	
<warSourceDirectory>src/webapp</warSourceDirectory>
				</configuration>
			</plugin> 
		</plugins>
	</pluginManagement>
 			<resources>
			<resource>
				<directory>target/fc</directory>
					<includes>
	
<include>fc.war</include>
					</includes>
					<excludes>
						<exclude>**.*</exclude>
					</excludes>
			</resource>
			</resources>
</build>
<dependencies>
	   <dependency>
			<groupId>org.apache.portals.bridges</groupId>
			<artifactId>portals-bridges-common</artifactId>
			<version>1.0.1-dev</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jdom</groupId>
			<artifactId>jdom</artifactId>
			<version>1.0</version>
		</dependency>
		<dependency>
			<groupId>FidelityCentral</groupId>
			<artifactId>fcCmStub</artifactId>
			<version>1.0</version>
		</dependency>
<!--		<dependency>
			<groupId>FidelityCentral</groupId>
			<artifactId>fc-auth</artifactId>
			<version>1.0</version>
		</dependency>-->
		<dependency>
			<groupId>FidelityCentral</groupId>
			<artifactId>fcCaching</artifactId>
			<version>1.0</version>
		</dependency>
		<dependency>
			<groupId>FidelityCentral</groupId>
			<artifactId>fcpf</artifactId>
			<version>1.0</version>
		</dependency>	
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.3</version>
			<scope>provided</scope>
		</dependency>
	    <dependency>
             <groupId>portlet-api</groupId>	
             <artifactId>portlet-api</artifactId>
             <version>1.0</version>
			 <scope>provided</scope>
       </dependency>
		<dependency>
			  <groupId>org.apache.pluto</groupId>
			  <artifactId>pluto</artifactId>
			  <version>1.0.1</version>
			  <scope>provided</scope>
  		</dependency>
	   <dependency>
	         <groupId>org.apache.portals.jetspeed-2</groupId>
             <artifactId>jetspeed-api</artifactId>
			 <version>2.1-dev</version>
			 <scope>provided</scope>
       </dependency>	
  </dependencies>	

</project> http://www.nabble.com/file/p11231529/pom.xml pom.xml 
 

  
-- 
View this message in context:
http://www.nabble.com/Issue-in-excluding-unwanted-jars-from-the-target-w
ar.-tf3958240s177.html#a11231529
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Issue in excluding unwanted jars from the target war.

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

you mean that for example this dependency:

   <dependency>
     <groupId>javax.servlet</groupId>
     <artifactId>servlet-api</artifactId>
     <version>2.3</version>
     <scope>provided</scope>
   </dependency>

is included in your war even though it has 'provided' scope?

Have you added the scope tag later on in your development and at first 
didn't use the 'provided' scope? Try making a clean build 'mvn clean 
package' or else the artifacts keep sticking in the target directory and 
are included in the final archiv.

-Tim

nitinaggarwal schrieb:
> Hi 
> 
> I am pretty new to maven 2.
> i am working on a portal (jsr 168 portlets) project on jetspeed 2.1 portal
> server and building using maven2.05.
> 
> when i use the mvn install command 
> the build is fine and i am successfully able to generate a fcapps.war file.
> 
> Everything seems working fine but the problem occurs when i try to deploy
> this war on jetspeed 2.1
> The fcapps.war file contains all the jars which i do not intend to use. 
> 
> when i try to run the application it gives me an error that application
> fcapps not available 
> and 
> only when i delete the unnecessary jars i am able to run the application
> properly this seems pretty wierd can any one help.
> 
> 
> 
> i only need these 7 jars to deploy my application 
>  
> commons-logging-1.0.3.jar
> ehcache-1.2.4.jar
> fcCaching-1.0.jar
> fcCmStub-1.0.jar
> fcpf-1.0.jar
> jdom-1.0.jar
> log4j-1.2.8.jar
> 
> i am attaching the pom.xml file for my project. 
> 
> 
> 
> 
> <!-- author Nitin Aggarwal 
> Project Object model for fidelity central application-->
> <project>
> <modelVersion>4.0.0</modelVersion>
> <parent>
> <groupId>FidelityCentral</groupId>
> <artifactId>application</artifactId>
> <version>1.0</version>
> </parent>
> <artifactId>fcapps</artifactId>
> <packaging>war</packaging>
> <name>Fidelity Central</name>
> <description>Fidelity Central Portlets</description>
> <version>1.0</version>
> <build>
> 	<sourceDirectory>src/java</sourceDirectory>
> 	<defaultGoal>install</defaultGoal>
> 	<pluginManagement>    
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
> 				<artifactId>maven-war-plugin</artifactId>
> 				<configuration>
> 					<warSourceDirectory>src/webapp</warSourceDirectory>
> 				</configuration>
> 			</plugin> 
> 		</plugins>
> 	</pluginManagement>
>  			<resources>
> 			<resource>
> 				<directory>target/fc</directory>
> 					<includes>
> 						<include>fc.war</include>
> 					</includes>
> 					<excludes>
> 						<exclude>**.*</exclude>
> 					</excludes>
> 			</resource>
> 			</resources>
> </build>
> <dependencies>
> 	   <dependency>
> 			<groupId>org.apache.portals.bridges</groupId>
> 			<artifactId>portals-bridges-common</artifactId>
> 			<version>1.0.1-dev</version>
> 			<scope>provided</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>jdom</groupId>
> 			<artifactId>jdom</artifactId>
> 			<version>1.0</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>FidelityCentral</groupId>
> 			<artifactId>fcCmStub</artifactId>
> 			<version>1.0</version>
> 		</dependency>
> <!--		<dependency>
> 			<groupId>FidelityCentral</groupId>
> 			<artifactId>fc-auth</artifactId>
> 			<version>1.0</version>
> 		</dependency>-->
> 		<dependency>
> 			<groupId>FidelityCentral</groupId>
> 			<artifactId>fcCaching</artifactId>
> 			<version>1.0</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>FidelityCentral</groupId>
> 			<artifactId>fcpf</artifactId>
> 			<version>1.0</version>
> 		</dependency>	
> 		<dependency>
> 			<groupId>javax.servlet</groupId>
> 			<artifactId>servlet-api</artifactId>
> 			<version>2.3</version>
> 			<scope>provided</scope>
> 		</dependency>
> 	    <dependency>
>              <groupId>portlet-api</groupId>	
>              <artifactId>portlet-api</artifactId>
>              <version>1.0</version>
> 			 <scope>provided</scope>
>        </dependency>
> 		<dependency>
> 			  <groupId>org.apache.pluto</groupId>
> 			  <artifactId>pluto</artifactId>
> 			  <version>1.0.1</version>
> 			  <scope>provided</scope>
>   		</dependency>
> 	   <dependency>
> 	         <groupId>org.apache.portals.jetspeed-2</groupId>
>              <artifactId>jetspeed-api</artifactId>
> 			 <version>2.1-dev</version>
> 			 <scope>provided</scope>
>        </dependency>	
>   </dependencies>	
> 
> </project> http://www.nabble.com/file/p11231529/pom.xml pom.xml 
>  
> 
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org