You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by RobJac <ro...@caritor.com> on 2006/04/20 13:27:09 UTC

Issue when packaging WAR Project

Hi,

I am using Maven 2 and the pom.xml of my WAR project looks like this

<project> 
  <modelVersion>4.0.0</modelVersion> 
  <name>DefinedBenefit_WEB</name> 
  <groupId>DefinedBenefit_WEB</groupId> 
  <artifactId>DefinedBenefit_WEB</artifactId> 
  <packaging>war</packaging> 
  <version>1.0</version> 
  <dependencies> 
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
  </dependencies> 
  <build> 
    <directory>${basedir}</directory>
    <outputDirectory>classes</outputDirectory>
    <finalName>${project.artifactId}</finalName>
    <testOutputDirectory>test-classes</testOutputDirectory>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <resources>
      <resource>
        <directory>${basedir}/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>test</directory>
      </testResource>
    </testResources>
	<plugins> 
	    <plugin>
	      <groupId>org.apache.maven.plugins</groupId>
	      <artifactId>maven-compiler-plugin</artifactId>
		<configuration>
		  <source>1.5</source>
		  <target>1.5</target>
		</configuration>
	       </plugin> 
		<plugin> 
			<groupId>org.apache.maven.plugins</groupId> 
			<artifactId>maven-surefire-plugin</artifactId> 
			<configuration> 
			  <skip>${unittests.skip}</skip> 
			  <testFailureIgnore>true</testFailureIgnore> 
			</configuration> 
		</plugin> 	       
		<plugin> 
		<groupId>org.apache.maven.plugins</groupId> 
		<artifactId>maven-war-plugin</artifactId> 
		<configuration> 
		<webXml>${basedir}/WebRoot/WEB-INF/web.xml</webXml> 
		</configuration> 
		</plugin> 
	</plugins> 
  </build> 
</project> 

I have 2 issues 
1.
When I am trying to execute mvn package. The WAR file gets created but none
of my jsp files are available in this. It only creates a WEB-INF folder and
a META_INF folder in my war file. Is there any changes that I need to do in
my pom xml for my jsp also to appear?
2.
The WEB-INF folder in the my WAR has the classes folder and the web.xml
folder, but there were some other files like .tld file and a
faces-config.xml file which also I wanted to appear in the WEB-INF folder
which has not happened? Am I missing something in my pom xml to specifically
have these files as well in my WEB-INF folder?
--
View this message in context: http://www.nabble.com/Issue-when-packaging-WAR-Project-t1479943.html#a4005384
Sent from the Maven - Users forum at Nabble.com.


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


Re: Issue when packaging WAR Project

Posted by Wayne Fay <wa...@gmail.com>.
Use <scope>provided</scope> for dependencies you wish to exclude.

Wayne

On 4/20/06, RobJac <ro...@caritor.com> wrote:
>
> Thanks, I have got it corrected now. I have one more issue. I have few
> dependency jars specified under the <dependency/> tag in my WAR pom xml .
> All thes jars are getting included under WEB-INF/lib folder. How can I
> exclude this while packaging my WAR project? Is there some tags I can use
> for this? I know we have something  <warSourceExcludes>, is this of any
> help? what do i need to provide in this tag to remove all my dependency jars
> --
> View this message in context: http://www.nabble.com/Issue-when-packaging-WAR-Project-t1479943.html#a4009330
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Issue when packaging WAR Project

Posted by RobJac <ro...@caritor.com>.
Thanks, I have got it corrected now. I have one more issue. I have few
dependency jars specified under the <dependency/> tag in my WAR pom xml .
All thes jars are getting included under WEB-INF/lib folder. How can I
exclude this while packaging my WAR project? Is there some tags I can use
for this? I know we have something  <warSourceExcludes>, is this of any
help? what do i need to provide in this tag to remove all my dependency jars
--
View this message in context: http://www.nabble.com/Issue-when-packaging-WAR-Project-t1479943.html#a4009330
Sent from the Maven - Users forum at Nabble.com.


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


Re: Issue when packaging WAR Project

Posted by Alexandre Poitras <al...@gmail.com>.
On 4/20/06, RobJac <ro...@caritor.com> wrote:
>
> Hi,
>
> I am using Maven 2 and the pom.xml of my WAR project looks like this
>
> <project>
>   <modelVersion>4.0.0</modelVersion>
>   <name>DefinedBenefit_WEB</name>
>   <groupId>DefinedBenefit_WEB</groupId>
>   <artifactId>DefinedBenefit_WEB</artifactId>
>   <packaging>war</packaging>
>   <version>1.0</version>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>       <scope>compile</scope>
>     </dependency>
>     <dependency>
>   </dependencies>
>   <build>
>     <directory>${basedir}</directory>
>     <outputDirectory>classes</outputDirectory>
>     <finalName>${project.artifactId}</finalName>
>     <testOutputDirectory>test-classes</testOutputDirectory>
>     <sourceDirectory>src</sourceDirectory>
>     <testSourceDirectory>test</testSourceDirectory>
>     <resources>
>       <resource>
>         <directory>${basedir}/resources</directory>
>       </resource>
>     </resources>
>     <testResources>
>       <testResource>
>         <directory>test</directory>
>       </testResource>
>     </testResources>
>         <plugins>
>             <plugin>
>               <groupId>org.apache.maven.plugins</groupId>
>               <artifactId>maven-compiler-plugin</artifactId>
>                 <configuration>
>                   <source>1.5</source>
>                   <target>1.5</target>
>                 </configuration>
>                </plugin>
>                 <plugin>
>                         <groupId>org.apache.maven.plugins</groupId>
>                         <artifactId>maven-surefire-plugin</artifactId>
>                         <configuration>
>                           <skip>${unittests.skip}</skip>
>                           <testFailureIgnore>true</testFailureIgnore>
>                         </configuration>
>                 </plugin>
>                 <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <configuration>
>                 <webXml>${basedir}/WebRoot/WEB-INF/web.xml</webXml>
>                 </configuration>
>                 </plugin>
>         </plugins>
>   </build>
> </project>
>
> I have 2 issuesMerant
> 1.
> When I am trying to execute mvn package. The WAR file gets created but none
> of my jsp files are available in this. It only creates a WEB-INF folder and
> a META_INF folder in my war file. Is there any changes that I need to do in
> my pom xml for my jsp also to appear?

You need to put them in src/main/webapp or change the directory in the
war plugin configuration.

> 2.
> The WEB-INF folder in the my WAR has the classes folder and the web.xml
> folder, but there were some other files like .tld file and a
> faces-config.xml file which also I wanted to appear in the WEB-INF folder
> which has not happened? Am I missing something in my pom xml to specifically
> have these files as well in my WEB-INF folder?

All the non-java files should be located under /src/main/resources. Is
it what you are doing?

> --
> View this message in context: http://www.nabble.com/Issue-when-packaging-WAR-Project-t1479943.html#a4005384
> Sent from the Maven - Users forum 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