You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Markus Wolf <ma...@emedia-solutions-wolf.de> on 2006/07/09 08:39:48 UTC

WEB-INF/lib excludes once more

Hi,

I have a problem creating my EAR file containing a WAR and a EJB.
First I setup my WAR-pom to have the EAR as provided dependency, but
then it is not possible to add it to the manifests classpath.
Then I read through the mailinglist and found an exclude configuration
should help. But no matter how I configure my excludes they are ignored...

I've checked the version of the war plugin as well and I'm using 2.0.1.
Is there anything I've overlooked in my pom.xml?

...
<dependencies>
  <dependency>
    <groupId>de.esw.services</groupId>
    <artifactId>emediaservices-core</artifactId>
    <version>1.0-SNAPSHOT</version>
    <scope>runtime</scope>
  </dependency>
  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>3.8.1</version>
    <scope>test</scope>
  </dependency>
</dependencies>
<build>
  <finalName>emediaservices-web</finalName>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <configuration>
        <excludes>
          <exclude>WEB-INF/lib/*.jar</exclude>
        </excludes>
        <archive>
          <manifest>
            <addClasspath>true</addClasspath>
          </manifest>
        </archive>
      </configuration>
    </plugin>
  </plugins>
</build>
...

Any ideas?
Thanks
Markus Wolf
-- 
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
> (040) 550 083 70
>
>>  web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>>  pgp: http://wwwkeys.de.pgp.net
>

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


RE: WEB-INF/lib excludes once more

Posted by Lukasz Szelag <ls...@accoona.com>.
OK, you're right and indeed excludes work in war-plugin 2.0.1. I thought that
Maven releases explicitly depend on certain versions of plugins.

-- 
View this message in context: http://www.nabble.com/WEB-INF-lib-excludes-once-more-tf1913187.html#a5333709
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: WEB-INF/lib excludes once more

Posted by Lukasz Szelag <ls...@accoona.com>.
OK, I meant that the WAR plugin which comes with 2.0.4 is broken. Anyways, is
there a way to include these libs automatically in the EAR without
explicitly specifying in EAR POM all dependencies from the WAR? This is how
EJB dependencies are treated in the EAR.

-- 
View this message in context: http://www.nabble.com/WEB-INF-lib-excludes-once-more-tf1913187.html#a5330992
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: WEB-INF/lib excludes once more

Posted by Lukasz Szelag <ls...@accoona.com>.
WAR plugin is broken in 2.0.4 so excludes don't work. As a workaround I'm
using the following:

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>package</id>
						<phase>package</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<!--
								 | Repackages the generated WAR file to exclude
								 | JARs from the WEB-INF/lib directory. This is
								 | a workaround until the WAR plugin is fixed to
								 | allow to exclude these files.
								 |-->
								 
								<property
									name="war.dir"
									value="${project.build.directory}/${project.build.finalName}"
								/>
								
								<unjar src="${war.dir}.war" dest="${war.dir}"/>

								<jar
									destfile="${war.dir}.war"
									basedir="${war.dir}"
									excludes="WEB-INF/lib/*.jar"
									manifest="${war.dir}/META-INF/MANIFEST.MF"
								/>
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>

-- 
View this message in context: http://www.nabble.com/WEB-INF-lib-excludes-once-more-tf1913187.html#a5327843
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: WEB-INF/lib excludes once more

Posted by Markus Wolf <ma...@markus-wolf.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> the exclude paramater of the war plugin is only meant for the webapp
> sources,
> the parameter name is a little bit vague. =)
> 
I think the docs are loo vague about excluding something and as well
adding something to the manifest classpath.

> if you want to exclude certain dependencies from the war, just specify
> the scope
> as compile. only dependencies with runtime scope will be included in the
> war.          
> 
The scope compile will remove the dep. from the manifest classpath as
well I think. The solution David Jencks posted as reply to my questions
seems the best suited for me.

But thanks for your input.
Markus Wolf
- --
__________________________________

      Markus Wolf
      Wedeler Landstrasse 63
      22559 Hamburg

 tel: (+49) 40 / 550 083 70
 mob: (+49) 177 / 288 48 67
 web: http://www.matrixweb.de
 icq: #109622365
 pgp: http://wwwkeys.de.pgp.net
__________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEsTWgYuGbqyQxpHcRAs1bAJ9o7vnoxObE55BgeHhuNb5UDB4aSQCgzaPK
Z/r/ImOtQehcpvsnklHoMyc=
=1wny
-----END PGP SIGNATURE-----

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


Re: WEB-INF/lib excludes once more

Posted by Pete Marvin King <la...@gmail.com>.
Hello,

the exclude paramater of the war plugin is only meant for the webapp
sources,
the parameter name is a little bit vague. =)

if you want to exclude certain dependencies from the war, just specify
the scope
as compile. only dependencies with runtime scope will be included in the
war.          

pete marvin


Markus Wolf wrote:
> Hi,
>
> I have a problem creating my EAR file containing a WAR and a EJB.
> First I setup my WAR-pom to have the EAR as provided dependency, but
> then it is not possible to add it to the manifests classpath.
> Then I read through the mailinglist and found an exclude configuration
> should help. But no matter how I configure my excludes they are ignored...
>
> I've checked the version of the war plugin as well and I'm using 2.0.1.
> Is there anything I've overlooked in my pom.xml?
>
> ...
> <dependencies>
>   <dependency>
>     <groupId>de.esw.services</groupId>
>     <artifactId>emediaservices-core</artifactId>
>     <version>1.0-SNAPSHOT</version>
>     <scope>runtime</scope>
>   </dependency>
>   <dependency>
>     <groupId>junit</groupId>
>     <artifactId>junit</artifactId>
>     <version>3.8.1</version>
>     <scope>test</scope>
>   </dependency>
> </dependencies>
> <build>
>   <finalName>emediaservices-web</finalName>
>   <plugins>
>     <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-war-plugin</artifactId>
>       <configuration>
>         <excludes>
>           <exclude>WEB-INF/lib/*.jar</exclude>
>         </excludes>
>         <archive>
>           <manifest>
>             <addClasspath>true</addClasspath>
>           </manifest>
>         </archive>
>       </configuration>
>     </plugin>
>   </plugins>
> </build>
> ...
>
> Any ideas?
> Thanks
> Markus Wolf
>   


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


Re: WEB-INF/lib excludes once more

Posted by Markus Wolf <ma...@emedia-solutions-wolf.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> With evenisse's help I just figured this out today and submitted a patch
> to the war plugin documentation, cf MWAR-61.
> 
> I assume that what you want is for the EJB jar to be in the war's
> manifest classpath and your mention of putting the ear on the m. cp is a
> typo?
> 
Thanks, this is exaclty what I was looking for. And since this does work
for the ejb and jar plugins as well it is very simple. :)

Thanks again
Markus Wolf
- --
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
> (040) 550 083 70
>
>>  web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>>  pgp: http://wwwkeys.de.pgp.net
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEsS/seyJE91ndMG4RAu6JAJ4q194vqmH0a//21Vk6HxJh+aJs1wCfVCS5
airHC0nwp+dkSg8qtixI7F8=
=hQlt
-----END PGP SIGNATURE-----

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


Re: WEB-INF/lib excludes once more

Posted by Markus Wolf <ma...@emedia-solutions-wolf.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have to add a note to this:
With the given POM snippet there are no dependencies generated in
eclipse project anymore. This is kind of anoying and should not counted
as proper solution for this I think.

Markus Wolf
- --
>
> emedia-solutions wolf
> Wedeler Landstrasse 63
> 22559 Hamburg
> (040) 550 083 70
>
>>  web: http://www.emedia-solutions-wolf.de
>> mail: markus@emedia-solutions-wolf.de
>>  pgp: http://wwwkeys.de.pgp.net
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEtK5leyJE91ndMG4RAlNaAJwOHFWN+Xsv8PPoP4Xv/jVa7tk1hgCfXDZ6
dCld7Wx448205RGnFPca+tY=
=LTu9
-----END PGP SIGNATURE-----

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


Re: WEB-INF/lib excludes once more

Posted by David Jencks <da...@yahoo.com>.
With evenisse's help I just figured this out today and submitted a  
patch to the war plugin documentation, cf MWAR-61.

I assume that what you want is for the EJB jar to be in the war's  
manifest classpath and your mention of putting the ear on the m. cp  
is a typo?

Here's my configuration that works for me:

     <build>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-war-plugin</artifactId>
                 <configuration>
                     <archive>
                         <manifest>
                             <addClasspath>true</addClasspath>
                         </manifest>
                     </archive>
                 </configuration>
             </plugin>
         </plugins>
     </build>
     <dependencies>
         <dependency>
             <groupId>org.apache.geronimo.itest</groupId>
             <artifactId>jar</artifactId>
             <version>${pom.version}</version>
             <optional>true</optional>
         </dependency>
     </dependencies>


The build/plugin configuration generates the manifest cp, and the  
<optional>true</optional> prevents maven from bundling the dependency  
into WEB-INF/lib.

Hope this is what you are looking for,
david jencks



On Jul 8, 2006, at 11:39 PM, Markus Wolf wrote:

> Hi,
>
> I have a problem creating my EAR file containing a WAR and a EJB.
> First I setup my WAR-pom to have the EAR as provided dependency, but
> then it is not possible to add it to the manifests classpath.
> Then I read through the mailinglist and found an exclude configuration
> should help. But no matter how I configure my excludes they are  
> ignored...
>
> I've checked the version of the war plugin as well and I'm using  
> 2.0.1.
> Is there anything I've overlooked in my pom.xml?
>
> ...
> <dependencies>
>   <dependency>
>     <groupId>de.esw.services</groupId>
>     <artifactId>emediaservices-core</artifactId>
>     <version>1.0-SNAPSHOT</version>
>     <scope>runtime</scope>
>   </dependency>
>   <dependency>
>     <groupId>junit</groupId>
>     <artifactId>junit</artifactId>
>     <version>3.8.1</version>
>     <scope>test</scope>
>   </dependency>
> </dependencies>
> <build>
>   <finalName>emediaservices-web</finalName>
>   <plugins>
>     <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-war-plugin</artifactId>
>       <configuration>
>         <excludes>
>           <exclude>WEB-INF/lib/*.jar</exclude>
>         </excludes>
>         <archive>
>           <manifest>
>             <addClasspath>true</addClasspath>
>           </manifest>
>         </archive>
>       </configuration>
>     </plugin>
>   </plugins>
> </build>
> ...
>
> Any ideas?
> Thanks
> Markus Wolf
> -- 
>>
>> emedia-solutions wolf
>> Wedeler Landstrasse 63
>> 22559 Hamburg
>> (040) 550 083 70
>>
>>>  web: http://www.emedia-solutions-wolf.de
>>> mail: markus@emedia-solutions-wolf.de
>>>  pgp: http://wwwkeys.de.pgp.net
>>
>
> ---------------------------------------------------------------------
> 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