You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by zm <zz...@hotmail.com> on 2010/05/20 10:48:27 UTC

Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Hi,

I'm having some trouble setting up a basic maven project structure. In this
case, I'm setting up an EAR project with an EJB and a WAR project inside.

I can successfully build the project, but the problem is as follows:

I define a defaultJavaBundleDir "lib/" on the ear pom. I want every jar
dependency to be inside that folder, except the ear modules ejb and war,
respectively.

It all works well, but looking at the manifest, I see a problem ... the
manifest of the war module has every entry with prefixed "lib/", so the ejb
it depends on is defined in the manifest as "lib/my-ejb.jar", when in
reality it is stored on the ear root.

I was expecting every jar to be prefixed with "lib/" except the webModule
and ejbModule entries defined in maven-ear-plugin.

Isn't it supposed to be like that? How can I make such setup?

Note: I'm not generating the ejb client (not using generateClient in ejb
pom), should this be a requirement? I'm new to maven+ejb setup like this, so
I need a bit of light ...


Thanks
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28618592.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.
More Info:

In my war pom, I have the following:

...
	<dependencies>
		<dependency>
			<groupId>com.test</groupId>
			<artifactId>my-ejb</artifactId>
			<type>ejb-client</type>
		</dependency>
...
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.0.1</version>
				<configuration>
					<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
						</manifest>
					</archive>
				</configuration>
			</plugin>


So I have on ear root the war, the ejb and the ejb-client archives, but the
manifest of the war as all entries prefixed with "lib/" so it doesn't find
the client ... I would need a way of forcing the ejb-client entry to have no
prefix (or "/" prefix).

I'm still looking for examples, but without success so far.


Thanks
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619438.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.


Wayne Fay wrote:
> 
> On Thu, May 20, 2010 at 10:41 AM, zm <zz...@hotmail.com> wrote:
> ....
> 
> zm, can you PLEASE hit the send button ONLY ONE TIME in the future??
> This is ridiculous. If you aren't sure if a message made it through to
> the list, check the list archive at Nabble.com.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

I assure you I did hit the button ONLY ONE TIME in the past. And yes, I saw
that on both times it replicated the message posted 4 times.

The last post I send, a few minutes ago I hit the post message using the
keyboard, just to test the behavior. This post will also be submitted with
keyboard, just to make sure.

This was not a n00b navigation action.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28631158.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.


Wayne Fay wrote:
> 
> On Thu, May 20, 2010 at 10:41 AM, zm <zz...@hotmail.com> wrote:
> ....
> 
> zm, can you PLEASE hit the send button ONLY ONE TIME in the future??
> This is ridiculous. If you aren't sure if a message made it through to
> the list, check the list archive at Nabble.com.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

I assure you I did hit the button ONLY ONE TIME in the past. And yes, I saw
that on both times it replicated the message posted 4 times.

The last post I send, a few minutes ago I hit the post message using the
keyboard, just to test the behavior. This post will also be submitted with
keyboard, just to make sure.

This was not a n00b navigation action.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28631155.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.


Wayne Fay wrote:
> 
> On Thu, May 20, 2010 at 10:41 AM, zm <zz...@hotmail.com> wrote:
> ....
> 
> zm, can you PLEASE hit the send button ONLY ONE TIME in the future??
> This is ridiculous. If you aren't sure if a message made it through to
> the list, check the list archive at Nabble.com.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

I assure you I did hit the button ONLY ONE TIME in the past. And yes, I saw
that on both times it replicated the message posted 4 times.

The last post I send, a few minutes ago I hit the post message using the
keyboard, just to test the behavior. This post will also be submitted with
keyboard, just to make sure.

This was not a n00b navigation action.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28631157.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.


Wayne Fay wrote:
> 
> On Thu, May 20, 2010 at 10:41 AM, zm <zz...@hotmail.com> wrote:
> ....
> 
> zm, can you PLEASE hit the send button ONLY ONE TIME in the future??
> This is ridiculous. If you aren't sure if a message made it through to
> the list, check the list archive at Nabble.com.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

I assure you I did hit the button ONLY ONE TIME in the past. And yes, I saw
that on both times it replicated the message posted 4 times.

The last post I send, a few minutes ago I hit the post message using the
keyboard, just to test the behavior. This post will also be submitted with
keyboard, just to make sure.

This was not a n00b navigation action.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28631156.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.


Wayne Fay wrote:
> 
> On Thu, May 20, 2010 at 10:41 AM, zm <zz...@hotmail.com> wrote:
> ....
> 
> zm, can you PLEASE hit the send button ONLY ONE TIME in the future??
> This is ridiculous. If you aren't sure if a message made it through to
> the list, check the list archive at Nabble.com.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

I assure you I did hit the button ONLY ONE TIME in the past. And yes, I saw
that on both times it replicated the message posted 4 times.

The last post I send, a few minutes ago I hit the post message using the
keyboard, just to test the behavior. This post will also be submitted with
keyboard, just to make sure.

This was not a n00b navigation action.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28631153.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by Wayne Fay <wa...@gmail.com>.
On Thu, May 20, 2010 at 10:41 AM, zm <zz...@hotmail.com> wrote:
....

zm, can you PLEASE hit the send button ONLY ONE TIME in the future??
This is ridiculous. If you aren't sure if a message made it through to
the list, check the list archive at Nabble.com.

Wayne

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


Re: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

Anders Hammar wrote:
> 
> Does it work (when deploying in the app server) if you just skip the
> manifest config part of the war plugin? I was under the impression that
> the
> manifest file doesn't really matter for war files, but I could be wrong.
> (You'd be accessing the classes from the classpath and that's handled by
> the
> container.)
> 
> /Anders
> 
> On Thu, May 20, 2010 at 12:29, zm <zz...@hotmail.com> wrote:
> 
>>
>> More Info:
>>
>> In my war pom, I have the following:
>>
>> ...
>>        <dependencies>
>>                <dependency>
>>                        <groupId>com.test</groupId>
>>                        <artifactId>my-ejb</artifactId>
>>                        <type>ejb-client</type>
>>                </dependency>
>> ...
>>                        <plugin>
>>                               
>> <groupId>org.apache.maven.plugins</groupId>
>>                                <artifactId>maven-war-plugin</artifactId>
>>                                <version>2.0.1</version>
>>                                <configuration>
>>
>>  <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>>                                        <archive>
>>                                                <manifest>
>>
>>  <addClasspath>true</addClasspath>
>>
>>  <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>>                                </configuration>
>>                        </plugin>
>>
>>
>> So I have on ear root the war, the ejb and the ejb-client archives, but
>> the
>> manifest of the war as all entries prefixed with "lib/" so it doesn't
>> find
>> the client ... I would need a way of forcing the ejb-client entry to have
>> no
>> prefix (or "/" prefix).
>>
>> I'm still looking for examples, but without success so far.
>>
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619436.html
>> 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
>>
>>
> 
> 


If I skip manifest creation, it will probably work, because every
dependencies will be copied to WEB-INF/lib, and since EJB will need manifest
and many of the same libs on the EAR, I will end with a monster size EAR
package because of duplicated jar dependencies ... :(
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28623062.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

Anders Hammar wrote:
> 
> Does it work (when deploying in the app server) if you just skip the
> manifest config part of the war plugin? I was under the impression that
> the
> manifest file doesn't really matter for war files, but I could be wrong.
> (You'd be accessing the classes from the classpath and that's handled by
> the
> container.)
> 
> /Anders
> 
> On Thu, May 20, 2010 at 12:29, zm <zz...@hotmail.com> wrote:
> 
>>
>> More Info:
>>
>> In my war pom, I have the following:
>>
>> ...
>>        <dependencies>
>>                <dependency>
>>                        <groupId>com.test</groupId>
>>                        <artifactId>my-ejb</artifactId>
>>                        <type>ejb-client</type>
>>                </dependency>
>> ...
>>                        <plugin>
>>                               
>> <groupId>org.apache.maven.plugins</groupId>
>>                                <artifactId>maven-war-plugin</artifactId>
>>                                <version>2.0.1</version>
>>                                <configuration>
>>
>>  <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>>                                        <archive>
>>                                                <manifest>
>>
>>  <addClasspath>true</addClasspath>
>>
>>  <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>>                                </configuration>
>>                        </plugin>
>>
>>
>> So I have on ear root the war, the ejb and the ejb-client archives, but
>> the
>> manifest of the war as all entries prefixed with "lib/" so it doesn't
>> find
>> the client ... I would need a way of forcing the ejb-client entry to have
>> no
>> prefix (or "/" prefix).
>>
>> I'm still looking for examples, but without success so far.
>>
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619436.html
>> 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
>>
>>
> 
> 


If I skip manifest creation, it will probably work, because every
dependencies will be copied to WEB-INF/lib, and since EJB will need manifest
and many of the same libs on the EAR, I will end with a monster size EAR
package because of duplicated jar dependencies ... :(
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28623057.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

Anders Hammar wrote:
> 
> Does it work (when deploying in the app server) if you just skip the
> manifest config part of the war plugin? I was under the impression that
> the
> manifest file doesn't really matter for war files, but I could be wrong.
> (You'd be accessing the classes from the classpath and that's handled by
> the
> container.)
> 
> /Anders
> 
> On Thu, May 20, 2010 at 12:29, zm <zz...@hotmail.com> wrote:
> 
>>
>> More Info:
>>
>> In my war pom, I have the following:
>>
>> ...
>>        <dependencies>
>>                <dependency>
>>                        <groupId>com.test</groupId>
>>                        <artifactId>my-ejb</artifactId>
>>                        <type>ejb-client</type>
>>                </dependency>
>> ...
>>                        <plugin>
>>                               
>> <groupId>org.apache.maven.plugins</groupId>
>>                                <artifactId>maven-war-plugin</artifactId>
>>                                <version>2.0.1</version>
>>                                <configuration>
>>
>>  <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>>                                        <archive>
>>                                                <manifest>
>>
>>  <addClasspath>true</addClasspath>
>>
>>  <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>>                                </configuration>
>>                        </plugin>
>>
>>
>> So I have on ear root the war, the ejb and the ejb-client archives, but
>> the
>> manifest of the war as all entries prefixed with "lib/" so it doesn't
>> find
>> the client ... I would need a way of forcing the ejb-client entry to have
>> no
>> prefix (or "/" prefix).
>>
>> I'm still looking for examples, but without success so far.
>>
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619436.html
>> 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
>>
>>
> 
> 


If I skip manifest creation, it will probably work, because every
dependencies will be copied to WEB-INF/lib, and since EJB will need manifest
and many of the same libs on the EAR, I will end with a monster size EAR
package because of duplicated jar dependencies ... :(
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28623061.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

Anders Hammar wrote:
> 
> Does it work (when deploying in the app server) if you just skip the
> manifest config part of the war plugin? I was under the impression that
> the
> manifest file doesn't really matter for war files, but I could be wrong.
> (You'd be accessing the classes from the classpath and that's handled by
> the
> container.)
> 
> /Anders
> 
> On Thu, May 20, 2010 at 12:29, zm <zz...@hotmail.com> wrote:
> 
>>
>> More Info:
>>
>> In my war pom, I have the following:
>>
>> ...
>>        <dependencies>
>>                <dependency>
>>                        <groupId>com.test</groupId>
>>                        <artifactId>my-ejb</artifactId>
>>                        <type>ejb-client</type>
>>                </dependency>
>> ...
>>                        <plugin>
>>                               
>> <groupId>org.apache.maven.plugins</groupId>
>>                                <artifactId>maven-war-plugin</artifactId>
>>                                <version>2.0.1</version>
>>                                <configuration>
>>
>>  <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>>                                        <archive>
>>                                                <manifest>
>>
>>  <addClasspath>true</addClasspath>
>>
>>  <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>>                                </configuration>
>>                        </plugin>
>>
>>
>> So I have on ear root the war, the ejb and the ejb-client archives, but
>> the
>> manifest of the war as all entries prefixed with "lib/" so it doesn't
>> find
>> the client ... I would need a way of forcing the ejb-client entry to have
>> no
>> prefix (or "/" prefix).
>>
>> I'm still looking for examples, but without success so far.
>>
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619436.html
>> 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
>>
>>
> 
> 


If I skip manifest creation, it will probably work, because every
dependencies will be copied to WEB-INF/lib, and since EJB will need manifest
and many of the same libs on the EAR, I will end with a monster size EAR
package because of duplicated jar dependencies ... :(
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28623059.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

zm wrote:
> 
> 
> Anders Hammar wrote:
>> 
>> I'm not sure we understand each other. I'm asking you to just skip this
>> part
>> of the war-plugin configuration:
>>                                        <archive>
>>                                                <manifest>
>> 
>>  <addClasspath>true</addClasspath>
>> 
>> <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>> 
>> You should still keep this:
>> <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>> 
>> /Anders
>> 
> 
> I'll will try that, and see the results.
> 

I've just tried it, and as far as I can tell, an EJB requires manifest
classpath to resolve dependencies, but a WAR module requires no WEB-INF\lib
and no manifest classpath to resolve them, as long as all dependencies are
available in the EAR package itself.

Now this just doesn't seem like a good practice ... but maintaining
dependencies on a big project really is a PITA ...

One strange thing I noticed when using an EJB client, was that although in
the WAR pom I only have a dependency to type "ejb-client", it correctly
inserts the client EJB on manifest classpath, but the WEB-INF\lib folder
ended with the full EJB package. Don't know if it is a bug on the war
plugin, but anyway I'll test this again.


Note: I have no clue why some of my posts are multi-submitted ... I'm
starting to suspect of my FF browser ... but it's strange, though. :-| I'll
post this one with keyboard only.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28632618.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

zm wrote:
> 
> 
> Anders Hammar wrote:
>> 
>> I'm not sure we understand each other. I'm asking you to just skip this
>> part
>> of the war-plugin configuration:
>>                                        <archive>
>>                                                <manifest>
>> 
>>  <addClasspath>true</addClasspath>
>> 
>> <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>> 
>> You should still keep this:
>> <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>> 
>> /Anders
>> 
> 
> I'll will try that, and see the results.
> 

I've just tried it, and as far as I can tell, an EJB requires manifest
classpath to resolve dependencies, but a WAR module requires no WEB-INF\lib
and no manifest classpath to resolve them, as long as all dependencies are
available in the EAR package itself.

Now this just doesn't seem like a good practice ... but maintaining
dependencies on a big project really is a PITA ...

One strange thing I noticed when using an EJB client, was that although in
the WAR pom I only have a dependency to type "ejb-client", it correctly
inserts the client EJB on manifest classpath, but the WEB-INF\lib folder
ended with the full EJB package. Don't know if it is a bug on the war
plugin, but anyway I'll test this again.


Note: I have no clue why some of my posts are multi-submitted ... I'm
starting to suspect of my FF browser ... but it's strange, though. :-| I'll
post this one with keyboard only.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28632620.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by Wayne Fay <wa...@gmail.com>.
> Note: I have no clue why some of my posts are multi-submitted ... I'm
> starting to suspect of my FF browser ... but it's strange, though. :-| I'll
> post this one with keyboard only.

Perhaps try submitting your questions via Nabble.com instead of Hotmail.

Wayne

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


Re: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

zm wrote:
> 
> 
> Anders Hammar wrote:
>> 
>> I'm not sure we understand each other. I'm asking you to just skip this
>> part
>> of the war-plugin configuration:
>>                                        <archive>
>>                                                <manifest>
>> 
>>  <addClasspath>true</addClasspath>
>> 
>> <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>> 
>> You should still keep this:
>> <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>> 
>> /Anders
>> 
> 
> I'll will try that, and see the results.
> 

I've just tried it, and as far as I can tell, an EJB requires manifest
classpath to resolve dependencies, but a WAR module requires no WEB-INF\lib
and no manifest classpath to resolve them, as long as all dependencies are
available in the EAR package itself.

Now this just doesn't seem like a good practice ... but maintaining
dependencies on a big project really is a PITA ...

One strange thing I noticed when using an EJB client, was that although in
the WAR pom I only have a dependency to type "ejb-client", it correctly
inserts the client EJB on manifest classpath, but the WEB-INF\lib folder
ended with the full EJB package. Don't know if it is a bug on the war
plugin, but anyway I'll test this again.


Note: I have no clue why some of my posts are multi-submitted ... I'm
starting to suspect of my FF browser ... but it's strange, though. :-| I'll
post this one with keyboard only.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28632616.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

zm wrote:
> 
> 
> Anders Hammar wrote:
>> 
>> I'm not sure we understand each other. I'm asking you to just skip this
>> part
>> of the war-plugin configuration:
>>                                        <archive>
>>                                                <manifest>
>> 
>>  <addClasspath>true</addClasspath>
>> 
>> <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>> 
>> You should still keep this:
>> <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>> 
>> /Anders
>> 
> 
> I'll will try that, and see the results.
> 

I've just tried it, and as far as I can tell, an EJB requires manifest
classpath to resolve dependencies, but a WAR module requires no WEB-INF\lib
and no manifest classpath to resolve them, as long as all dependencies are
available in the EAR package itself.

Now this just doesn't seem like a good practice ... but maintaining
dependencies on a big project really is a PITA ...

One strange thing I noticed when using an EJB client, was that although in
the WAR pom I only have a dependency to type "ejb-client", it correctly
inserts the client EJB on manifest classpath, but the WEB-INF\lib folder
ended with the full EJB package. Don't know if it is a bug on the war
plugin, but anyway I'll test this again.


Note: I have no clue why some of my posts are multi-submitted ... I'm
starting to suspect of my FF browser ... but it's strange, though. :-| I'll
post this one with keyboard only.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28632619.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

zm wrote:
> 
> 
> Anders Hammar wrote:
>> 
>> I'm not sure we understand each other. I'm asking you to just skip this
>> part
>> of the war-plugin configuration:
>>                                        <archive>
>>                                                <manifest>
>> 
>>  <addClasspath>true</addClasspath>
>> 
>> <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>> 
>> You should still keep this:
>> <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>> 
>> /Anders
>> 
> 
> I'll will try that, and see the results.
> 

I've just tried it, and as far as I can tell, an EJB requires manifest
classpath to resolve dependencies, but a WAR module requires no WEB-INF\lib
and no manifest classpath to resolve them, as long as all dependencies are
available in the EAR package itself.

Now this just doesn't seem like a good practice ... but maintaining
dependencies on a big project really is a PITA ...

One strange thing I noticed when using an EJB client, was that although in
the WAR pom I only have a dependency to type "ejb-client", it correctly
inserts the client EJB on manifest classpath, but the WEB-INF\lib folder
ended with the full EJB package. Don't know if it is a bug on the war
plugin, but anyway I'll test this again.


Note: I have no clue why some of my posts are multi-submitted ... I'm
starting to suspect of my FF browser ... but it's strange, though. :-| I'll
post this one with keyboard only.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28632617.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

Anders Hammar wrote:
> 
> I'm not sure we understand each other. I'm asking you to just skip this
> part
> of the war-plugin configuration:
>                                        <archive>
>                                                <manifest>
> 
>  <addClasspath>true</addClasspath>
> 
> <classpathPrefix>lib/</classpathPrefix>
>                                                </manifest>
>                                        </archive>
> 
> You should still keep this:
> <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
> 
> /Anders
> 

I'll will try that, and see the results.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28631100.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by Anders Hammar <an...@hammar.net>.
I'm not sure we understand each other. I'm asking you to just skip this part
of the war-plugin configuration:
                                       <archive>
                                               <manifest>

 <addClasspath>true</addClasspath>

<classpathPrefix>lib/</classpathPrefix>
                                               </manifest>
                                       </archive>

You should still keep this:
<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>

/Anders

On Thu, May 20, 2010 at 17:41, zm <zz...@hotmail.com> wrote:

>
>
> Anders Hammar wrote:
> >
> > Does it work (when deploying in the app server) if you just skip the
> > manifest config part of the war plugin? I was under the impression that
> > the
> > manifest file doesn't really matter for war files, but I could be wrong.
> > (You'd be accessing the classes from the classpath and that's handled by
> > the
> > container.)
> >
> > /Anders
> >
> > On Thu, May 20, 2010 at 12:29, zm <zz...@hotmail.com> wrote:
> >
> >>
> >> More Info:
> >>
> >> In my war pom, I have the following:
> >>
> >> ...
> >>        <dependencies>
> >>                <dependency>
> >>                        <groupId>com.test</groupId>
> >>                        <artifactId>my-ejb</artifactId>
> >>                        <type>ejb-client</type>
> >>                </dependency>
> >> ...
> >>                        <plugin>
> >>
> >> <groupId>org.apache.maven.plugins</groupId>
> >>                                <artifactId>maven-war-plugin</artifactId>
> >>                                <version>2.0.1</version>
> >>                                <configuration>
> >>
> >>  <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
> >>                                        <archive>
> >>                                                <manifest>
> >>
> >>  <addClasspath>true</addClasspath>
> >>
> >>  <classpathPrefix>lib/</classpathPrefix>
> >>                                                </manifest>
> >>                                        </archive>
> >>                                </configuration>
> >>                        </plugin>
> >>
> >>
> >> So I have on ear root the war, the ejb and the ejb-client archives, but
> >> the
> >> manifest of the war as all entries prefixed with "lib/" so it doesn't
> >> find
> >> the client ... I would need a way of forcing the ejb-client entry to
> have
> >> no
> >> prefix (or "/" prefix).
> >>
> >> I'm still looking for examples, but without success so far.
> >>
> >>
> >> Thanks
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619436.html
> >> 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
> >>
> >>
> >
> >
>
>
> If I skip manifest creation, it will probably work, because every
> dependencies will be copied to WEB-INF/lib, and since EJB will need
> manifest
> and many of the same libs on the EAR, I will end with a monster size EAR
> package because of duplicated jar dependencies ... :(
> --
> View this message in context:
> http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28623056.html
> 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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

Anders Hammar wrote:
> 
> Does it work (when deploying in the app server) if you just skip the
> manifest config part of the war plugin? I was under the impression that
> the
> manifest file doesn't really matter for war files, but I could be wrong.
> (You'd be accessing the classes from the classpath and that's handled by
> the
> container.)
> 
> /Anders
> 
> On Thu, May 20, 2010 at 12:29, zm <zz...@hotmail.com> wrote:
> 
>>
>> More Info:
>>
>> In my war pom, I have the following:
>>
>> ...
>>        <dependencies>
>>                <dependency>
>>                        <groupId>com.test</groupId>
>>                        <artifactId>my-ejb</artifactId>
>>                        <type>ejb-client</type>
>>                </dependency>
>> ...
>>                        <plugin>
>>                               
>> <groupId>org.apache.maven.plugins</groupId>
>>                                <artifactId>maven-war-plugin</artifactId>
>>                                <version>2.0.1</version>
>>                                <configuration>
>>
>>  <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>>                                        <archive>
>>                                                <manifest>
>>
>>  <addClasspath>true</addClasspath>
>>
>>  <classpathPrefix>lib/</classpathPrefix>
>>                                                </manifest>
>>                                        </archive>
>>                                </configuration>
>>                        </plugin>
>>
>>
>> So I have on ear root the war, the ejb and the ejb-client archives, but
>> the
>> manifest of the war as all entries prefixed with "lib/" so it doesn't
>> find
>> the client ... I would need a way of forcing the ejb-client entry to have
>> no
>> prefix (or "/" prefix).
>>
>> I'm still looking for examples, but without success so far.
>>
>>
>> Thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619436.html
>> 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
>>
>>
> 
> 


If I skip manifest creation, it will probably work, because every
dependencies will be copied to WEB-INF/lib, and since EJB will need manifest
and many of the same libs on the EAR, I will end with a monster size EAR
package because of duplicated jar dependencies ... :(
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28623056.html
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: How do you mavenize projects ? (EJB, Webapp, JPA under Eclipse)

Posted by Thiébault Benoît <de...@artenum.com>.
Hi Celinio,

You should download the book http://repo.exist.com/dist/maestro/1.7.0/BetterBuildsWithMaven.pdf
Chapter 8 gives an example of Maven migration

Hope this helps
Benoît

Le 20 mai 2010 à 15:46, Celinio Fernandes a écrit :

> Hi,
> I am using Eclipse Galileo.
> Initially I created several projects (one webapp, one EJB project, one JPA project) in Eclipse, without Maven.
> The output of these projects is a single EAR file (containing the JAR, WAR files ...).
> There is no ANT build file. The compilation and creation of the EAR file is automatically generated with Eclipse.
> I am using Java 6 and Maven 2.0.9.
> 
> The question is : how do you mavenize these projects ?
> 
> 
> 1) If I use the command line way to use Maven, under DOS, what do i need to do for each project ?
> 
> 2) I have installed the m2Eclipse (Maven Integration) plugin for Eclipse. If I use that plugin,
> how do i proceed ? I just noticed a feature called "Enable Dependency Management" if i right click on a project.
> what does it do ?
> 
> Any suggestion or pointer would be much appreciated.
> Thanks in advance for helping.
> 
> 
> 
> 


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


How do you mavenize projects ? (EJB, Webapp, JPA under Eclipse)

Posted by Celinio Fernandes <ce...@yahoo.com>.
Hi,
I am using Eclipse Galileo.
Initially I created several projects (one webapp, one EJB project, one JPA project) in Eclipse, without Maven.
The output of these projects is a single EAR file (containing the JAR, WAR files ...).
There is no ANT build file. The compilation and creation of the EAR file is automatically generated with Eclipse.
I am using Java 6 and Maven 2.0.9.

The question is : how do you mavenize these projects ?


1) If I use the command line way to use Maven, under DOS, what do i need to do for each project ?

2) I have installed the m2Eclipse (Maven Integration) plugin for Eclipse. If I use that plugin,
how do i proceed ? I just noticed a feature called "Enable Dependency Management" if i right click on a project.
what does it do ?

Any suggestion or pointer would be much appreciated.
Thanks in advance for helping.




      

Re: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by Anders Hammar <an...@hammar.net>.
Does it work (when deploying in the app server) if you just skip the
manifest config part of the war plugin? I was under the impression that the
manifest file doesn't really matter for war files, but I could be wrong.
(You'd be accessing the classes from the classpath and that's handled by the
container.)

/Anders

On Thu, May 20, 2010 at 12:29, zm <zz...@hotmail.com> wrote:

>
> More Info:
>
> In my war pom, I have the following:
>
> ...
>        <dependencies>
>                <dependency>
>                        <groupId>com.test</groupId>
>                        <artifactId>my-ejb</artifactId>
>                        <type>ejb-client</type>
>                </dependency>
> ...
>                        <plugin>
>                                <groupId>org.apache.maven.plugins</groupId>
>                                <artifactId>maven-war-plugin</artifactId>
>                                <version>2.0.1</version>
>                                <configuration>
>
>  <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
>                                        <archive>
>                                                <manifest>
>
>  <addClasspath>true</addClasspath>
>
>  <classpathPrefix>lib/</classpathPrefix>
>                                                </manifest>
>                                        </archive>
>                                </configuration>
>                        </plugin>
>
>
> So I have on ear root the war, the ejb and the ejb-client archives, but the
> manifest of the war as all entries prefixed with "lib/" so it doesn't find
> the client ... I would need a way of forcing the ejb-client entry to have
> no
> prefix (or "/" prefix).
>
> I'm still looking for examples, but without success so far.
>
>
> Thanks
> --
> View this message in context:
> http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619436.html
> 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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.
More Info:

In my war pom, I have the following:

...
	<dependencies>
		<dependency>
			<groupId>com.test</groupId>
			<artifactId>my-ejb</artifactId>
			<type>ejb-client</type>
		</dependency>
...
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.0.1</version>
				<configuration>
					<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
						</manifest>
					</archive>
				</configuration>
			</plugin>


So I have on ear root the war, the ejb and the ejb-client archives, but the
manifest of the war as all entries prefixed with "lib/" so it doesn't find
the client ... I would need a way of forcing the ejb-client entry to have no
prefix (or "/" prefix).

I'm still looking for examples, but without success so far.


Thanks
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619436.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.
More Info:

In my war pom, I have the following:

...
	<dependencies>
		<dependency>
			<groupId>com.test</groupId>
			<artifactId>my-ejb</artifactId>
			<type>ejb-client</type>
		</dependency>
...
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.0.1</version>
				<configuration>
					<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
						</manifest>
					</archive>
				</configuration>
			</plugin>


So I have on ear root the war, the ejb and the ejb-client archives, but the
manifest of the war as all entries prefixed with "lib/" so it doesn't find
the client ... I would need a way of forcing the ejb-client entry to have no
prefix (or "/" prefix).

I'm still looking for examples, but without success so far.


Thanks
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619440.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.
More Info:

In my war pom, I have the following:

...
	<dependencies>
		<dependency>
			<groupId>com.test</groupId>
			<artifactId>my-ejb</artifactId>
			<type>ejb-client</type>
		</dependency>
...
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.0.1</version>
				<configuration>
					<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
						</manifest>
					</archive>
				</configuration>
			</plugin>


So I have on ear root the war, the ejb and the ejb-client archives, but the
manifest of the war as all entries prefixed with "lib/" so it doesn't find
the client ... I would need a way of forcing the ejb-client entry to have no
prefix (or "/" prefix).

I'm still looking for examples, but without success so far.


Thanks
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619439.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.
More Info:

In my war pom, I have the following:

...
	<dependencies>
		<dependency>
			<groupId>com.test</groupId>
			<artifactId>my-ejb</artifactId>
			<type>ejb-client</type>
		</dependency>
...
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.0.1</version>
				<configuration>
					<warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
						</manifest>
					</archive>
				</configuration>
			</plugin>


So I have on ear root the war, the ejb and the ejb-client archives, but the
manifest of the war as all entries prefixed with "lib/" so it doesn't find
the client ... I would need a way of forcing the ejb-client entry to have no
prefix (or "/" prefix).

I'm still looking for examples, but without success so far.


Thanks
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28619437.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by Stephen Coy <st...@resolvesw.com>.
The answer to this question depends very much on what appserver (vendor and version) you are using.

If it is a JEE5 compliant server (JBoss 5.x, WebLogic 10.x, WebSphere 7.x)*, then you do not need manifest classpaths to be generated at all. All jars placed in the lib directory of the EAR will be visible to both EJB and WAR classes.

If it is an earlier version, the answer becomes vendor dependent as some support the JEE5 behaviour (as a vendor extension) and some don't.

Unfortunately, setting Maven up to put the correct jars in a WAR's WEB-INF/lib and an EAR's lib directory has to be done by hand with explicit dependency control in the case of the EAR and controlled use of <warSourceExcludes> in the war plugin configuration.

Cheers,

Steve C

* There's others, such as glassfish, but I'm not familiar with them.

On 20/05/2010, at 6:48 PM, zm wrote:

> 
> Hi,
> 
> I'm having some trouble setting up a basic maven project structure. In this
> case, I'm setting up an EAR project with an EJB and a WAR project inside.
> 
> I can successfully build the project, but the problem is as follows:
> 
> I define a defaultJavaBundleDir "lib/" on the ear pom. I want every jar
> dependency to be inside that folder, except the ear modules ejb and war,
> respectively.
> 
> It all works well, but looking at the manifest, I see a problem ... the
> manifest of the war module has every entry with prefixed "lib/", so the ejb
> it depends on is defined in the manifest as "lib/my-ejb.jar", when in
> reality it is stored on the ear root.
> 
> I was expecting every jar to be prefixed with "lib/" except the webModule
> and ejbModule entries defined in maven-ear-plugin.
> 
> Isn't it supposed to be like that? How can I make such setup?
> 
> Note: I'm not generating the ejb client (not using generateClient in ejb
> pom), should this be a requirement? I'm new to maven+ejb setup like this, so
> I need a bit of light ...
> 
> 
> Thanks
> -- 
> View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28618592.html
> 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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by zm <zz...@hotmail.com>.

Stephen Coy-3 wrote:
> 
> On 21/05/2010, at 10:14 PM, Nicola Musatti wrote:
> 
>> Are you sure about this? I'm asking because this is not the behaviour I'm
>> seeing for a WAR deployed to Websphere 7.0.0.7. In order for the
>> containing EAR's jar's to be visible from the WAR I have to specify them
>> explicitly in the WAR's manifest.
> 
> 
> From "JavaTM Platform, Enterprise Edition (Java EE) Specification, v5"
> 
> EE.8.2.1	Bundled Libraries
> 
> 1. ...
> 
> 2. A .ear file may contain a directory that contains libraries packaged in
> JAR files. The library-directory element of the.earfile’s deployment
> descriptor contains the name of this directory. If a library-directory
> element isn’t specified, or if the .ear file does not contain a deployment
> descriptor, the directory named lib is used. An empty library-directory
> element may be used to specify that there is no library directory.
> All files in this directory (but not subdirectories) with a .jar extension
> must be made available to all components packaged in the EAR file,
> including application clients. These libraries may reference other
> libraries, either bundled with the application or installed separately,
> using any of the techniques described herein.
> 
> 3. A web application may include libraries in the WEB-INF/lib directory.
> See the Servlet specification for details. These libraries may reference
> other libraries, either bundled with the application or installed
> separately, using any of the techniques described herein.
> 
> The usual reason for this not working is using an old (J2EE 1.3 or 1.4)
> DTD/schema in the application.xml file.
> 
> Cheers,
> 
> Steve C
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

Perfect, that was exactly what I was thinking, that the specification should
define this.

This eases the work of making a cross-application-server EAR archive. Also
not needing the manifest entries makes it more easy to maintain the pom
files for maven.

We have so much stuff to worry about, that these small definitions help
alot.

I'll definitely try it on JBoss, WebSphere and Geronimo to check it out

Thanks.


Note about posting: I post in nabble.com, this time I'll post using Internet
Explorer.
-- 
View this message in context: http://old.nabble.com/Maven-EAR-%2B-EJB-...-jars-with-prefixed-%22lib-%22-except-for-EJB-tp28618592p28655173.html
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: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by Stephen Coy <st...@resolvesw.com>.
On 21/05/2010, at 10:14 PM, Nicola Musatti wrote:

> Are you sure about this? I'm asking because this is not the behaviour I'm seeing for a WAR deployed to Websphere 7.0.0.7. In order for the containing EAR's jar's to be visible from the WAR I have to specify them explicitly in the WAR's manifest.


From "JavaTM Platform, Enterprise Edition (Java EE) Specification, v5"

EE.8.2.1	Bundled Libraries

1. ...

2. A .ear file may contain a directory that contains libraries packaged in JAR files. The library-directory element of the.earfile’s deployment descriptor contains the name of this directory. If a library-directory element isn’t specified, or if the .ear file does not contain a deployment descriptor, the directory named lib is used. An empty library-directory element may be used to specify that there is no library directory.
All files in this directory (but not subdirectories) with a .jar extension must be made available to all components packaged in the EAR file, including application clients. These libraries may reference other libraries, either bundled with the application or installed separately, using any of the techniques described herein.

3. A web application may include libraries in the WEB-INF/lib directory. See the Servlet specification for details. These libraries may reference other libraries, either bundled with the application or installed separately, using any of the techniques described herein.

The usual reason for this not working is using an old (J2EE 1.3 or 1.4) DTD/schema in the application.xml file.

Cheers,

Steve C


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


Re: Maven EAR + EJB ... jars with prefixed "lib/" except for EJB

Posted by Nicola Musatti <Ni...@ObjectWay.it>.
Stephen Coy wrote:
> The answer to this question depends very much on what appserver (vendor and version) you are using.
>
> If it is a JEE5 compliant server (JBoss 5.x, WebLogic 10.x, WebSphere 7.x)*, then you do not need manifest classpaths to be generated at all. All jars placed in the lib directory of the EAR will be visible to both EJB and WAR classes.
>
>    
Are you sure about this? I'm asking because this is not the behaviour 
I'm seeing for a WAR deployed to Websphere 7.0.0.7. In order for the 
containing EAR's jar's to be visible from the WAR I have to specify them 
explicitly in the WAR's manifest. This, on the other hand, is not 
necessary for JBoss 5.1, as you say.

This wouldn't be so bad if it weren't for the fact that all transitive 
dependencies have to be specified in the POM, so that they are 
explicitly mentioned in the manifest classpath.

Cheers,
Nicola Musatti

[...]

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