maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Pöllath <li...@poellath.org>
Subject Re: [M2] How to exclude dependency from WAR's WEB-INF/lib
Date Fri, 11 Nov 2005 16:27:15 GMT
How do I prevent including JARs in WEB-INF/lib? I need a "compile  
only" scope!
http://maven.apache.org/general.html#scope-provided

Cheers,
-Ralph.

On 11.11.2005, at 15:55, Simeon Koptelov wrote:
> I'm porting my project build system from Ant to Maven 2.0 and can  
> not find the
> right way to do it. I googled and found that I should use
> <properties><war.bundle>false</war.bundle></properties>
> But it gives me parsing error (stack trace in the end of this  
> mail). I also
> read that <scope>compile</scope> doesn't do what I want (and my  
> opinion is
> that it's really against common sense - I want library in compile  
> and don't
> want in package).
>
> So can anyone please explain how to exclude dependency jar from WEB- 
> INF/lib ?
>
> pom.xml:
>
> <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/maven-v4_0_0.xsd"
>>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.fis</groupId>
>   <artifactId>fis-web</artifactId>
>   <packaging>war</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>FIS web application</name>
>   <url>http://www.fis.ru</url>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>       <scope>test</scope>
>     </dependency>
>
>       <dependency>
>         <groupId>commons-codec</groupId>
>         <artifactId>commons-codec</artifactId>
>         <version>1.3</version>
>       </dependency>
>
> <!--
> 	... Many deps skipped	
> -->
>
> 	<!-- This I don't want to include in WAR -->
>         <dependency>
>           <groupId>com.fis</groupId>
>           <artifactId>fis-jmx</artifactId>
>           <version>1.0-SNAPSHOT</version>
>           <properties>
>               <war.bundle>false</war.bundle>
>           </properties>
>         </dependency>
>
>     </dependencies>
>
>     <build>
>         <finalName>fis-web</finalName>
>         <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-war-plugin</artifactId>
>             </plugin>
>         </plugins>
>     </build>
> </project>
>
>
>
> Parser error stack trace:
>
> org.apache.maven.reactor.MavenExecutionException: Parse error  
> reading POM
>         at org.apache.maven.DefaultMaven.getProjects 
> (DefaultMaven.java:359)
>         at org.apache.maven.DefaultMaven.doExecute 
> (DefaultMaven.java:276)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java: 
> 113)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.codehaus.classworlds.Launcher.launchEnhanced 
> (Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.project.InvalidProjectModelException:  
> Parse error
> reading POM
>         at
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel 
> (DefaultMavenProjectBuilder.java:1097)
>         at
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel 
> (DefaultMavenProjectBuilder.java:1057)
>         at
> org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFil 
> e(DefaultMavenProjectBuilder.java:291)
>         at
> org.apache.maven.project.DefaultMavenProjectBuilder.build 
> (DefaultMavenProjectBuilder.java:276)
>         at org.apache.maven.DefaultMaven.getProject 
> (DefaultMaven.java:509)
>         at
> org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:441)
>         at org.apache.maven.DefaultMaven.getProjects 
> (DefaultMaven.java:345)
>         ... 11 more
> Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException:
> Unrecognised tag: 'properties' (position: START_TAG seen ...</ 
> version>\r\n
> <properties>... @210:23)
>         at
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseDependency 
> (MavenXpp3Reader.java:1202)
>         at
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.parseModel 
> (MavenXpp3Reader.java:2230)
>         at
> org.apache.maven.model.io.xpp3.MavenXpp3Reader.read 
> (MavenXpp3Reader.java:4255)
>         at
> org.apache.maven.project.DefaultMavenProjectBuilder.readModel 
> (DefaultMavenProjectBuilder.java:1093)
>         ... 17 more
>
>
>
> -- 
> Simeon Koptelov,
> RIC FIS Inc.


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


Mime
View raw message