You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jim Collings <jl...@gmail.com> on 2009/08/28 22:06:34 UTC

Need a separate jar from war in assembly

So I have a jar that needs to be in an assembly but not in the war
file. It's a jdbc driver for the appserver.
How can I get it into the compressed archive but outside of the *.war file?

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


Re: Need a separate jar from war in assembly

Posted by James Russo <jr...@halo3.net>.
Jim Collings wrote:
> I've created a xx-weblogic module. That part was easy. Problem is that
> there is no lib dir. Maven doesn't copy libs to the source tree in
> accordance with the idea that they should not be in the version
> control system. So the question remains... how do I get the jar from
> the repository and into the assembly?
>   
The war plugin should be moving all the dependencies into the lib 
directory in WEB-INF/lib. Are you sure
you have specified the correct dependencies (ie: xx-weblogic?) in the 
xx-webapp module?

In my situation, I have xx-common, xx-server, xx-weblogic module all as 
jar maven modules. They all end up
in my WEB-INF/lib directory of my xx-webapp module along with any 
transitive dependencies like spring, commons-*, etc.

-jr

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


Re: Need a separate jar from war in assembly

Posted by Jim Collings <jl...@gmail.com>.
>>   So, the recommended way is to have something like this, correct?
>>
>>   xx-weblogic (all code for web-application)
>>   xx-webapp (the actual war, containing src/main/webapp, src/main/resources,
>> but no src/main. Code is really included though .jar files in lib).

I've created a xx-weblogic module. That part was easy. Problem is that
there is no lib dir. Maven doesn't copy libs to the source tree in
accordance with the idea that they should not be in the version
control system. So the question remains... how do I get the jar from
the repository and into the assembly?

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


Re: Need a separate jar from war in assembly

Posted by Jim Collings <jl...@gmail.com>.
This is still a problem. Still not working. Clues anyone?

On Mon, Aug 31, 2009 at 10:50 AM, Jim Collings<jl...@gmail.com> wrote:
> BTW, I've tried this by using a dependancySet in the descriptor. This
> didn't work out.
>

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


Re: Need a separate jar from war in assembly

Posted by Jim Collings <jl...@gmail.com>.
BTW, I've tried this by using a dependancySet in the descriptor. This
didn't work out.

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


Re: Need a separate jar from war in assembly

Posted by Jim Collings <jl...@gmail.com>.
The question in question was mine rather than Mr. Russo's. ;-)

So I've created a SunWebserver module and added the jar as a
dependency.  What maven is producing now is nothing when I use the
compile goal and a jar with manifest.mf, pom.xml, pom.properties etc.
Still no jar though. Not even as a subcomponent of the produced jar
file.


Jim C.


On Fri, Aug 28, 2009 at 10:43 PM, Wendy Smoak<ws...@gmail.com> wrote:
> Yes, it's common to have the code in a separate module from the
> webapp.  It makes it easier to do unit testing of the code separately
> from integration testing the webapp.
>
> I'm not sure how that relates to your original question though.  I see
> the jar module and the war module... where is the assembly plugin
> configured?  (Or, were you using 'assembly' in a generic sense?)
>
> If you're just trying to convince Maven not to put your JDBC driver in
> the war, try using 'provided' scope for that dependency.

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


Re: Need a separate jar from war in assembly

Posted by Wendy Smoak <ws...@gmail.com>.
Yes, it's common to have the code in a separate module from the
webapp.  It makes it easier to do unit testing of the code separately
from integration testing the webapp.

I'm not sure how that relates to your original question though.  I see
the jar module and the war module... where is the assembly plugin
configured?  (Or, were you using 'assembly' in a generic sense?)

If you're just trying to convince Maven not to put your JDBC driver in
the war, try using 'provided' scope for that dependency.

-- 
Wendy

On Fri, Aug 28, 2009 at 1:31 PM, James Russo<jr...@halo3.net> wrote:
> Hello,
>
>   So, the recommended way is to have something like this, correct?
>
>   xx-weblogic (all code for web-application)
>   xx-webapp (the actual war, containing src/main/webapp, src/main/resources,
> but no src/main. Code is really included though .jar files in lib).
...

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


Re: Need a separate jar from war in assembly

Posted by James Russo <jr...@halo3.net>.
Hello,

    So, the recommended way is to have something like this, correct?

    xx-weblogic (all code for web-application)
    xx-webapp (the actual war, containing src/main/webapp, 
src/main/resources, but no src/main. Code is really included though .jar 
files in lib).

-jr

Wendy Smoak wrote:
> On Fri, Aug 28, 2009 at 1:06 PM, Jim Collings<jl...@gmail.com> wrote:
>   
>> So I have a jar that needs to be in an assembly but not in the war
>> file. It's a jdbc driver for the appserver.
>> How can I get it into the compressed archive but outside of the *.war file?
>>     
>
> How is your project structured now?  Are you trying to build the
> assembly out of the same module that builds the webapp?
>
> If so, moving the assembly to a separate module may make things easier.
>
> I'm guessing, so if that's not it, give us more details.
>
>   

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


Re: Need a separate jar from war in assembly

Posted by Wendy Smoak <ws...@gmail.com>.
On Fri, Aug 28, 2009 at 1:06 PM, Jim Collings<jl...@gmail.com> wrote:
> So I have a jar that needs to be in an assembly but not in the war
> file. It's a jdbc driver for the appserver.
> How can I get it into the compressed archive but outside of the *.war file?

How is your project structured now?  Are you trying to build the
assembly out of the same module that builds the webapp?

If so, moving the assembly to a separate module may make things easier.

I'm guessing, so if that's not it, give us more details.

-- 
Wendy

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