You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Lachlan Deck <la...@gmail.com> on 2008/04/22 06:48:31 UTC

assembly help

Hi there,

I'm still quite new to maven... so any demos appreciated :-)

I'm needing to create a directory-based assembly (ideally it would be  
tgz or zipped up afterwards) - but I'm not quite sure how to go about  
the following.

The project looks like this:
/pom.xml
frameworks/
	pom.xml
	moduleA
	etc
apps/
	app1
	etc
	
The apps need to be built as application bundles...e.g.,
<finalName>.someExtension/
	Dependencies/*.jar <!-- all but system/test scoped dependencies -->
	Resources/Java/<finalName>.jar
	etc

I also need to append to a textfile the list of dependencies prefixed  
by a custom path (one entry per line).

Any examples/ideas?
Thanks

with regards,
--

Lachlan Deck


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


Re: assembly help

Posted by Lachlan Deck <la...@gmail.com>.
Hi Henrique,

On 24/04/2008, at 1:23 AM, Henrique Prange wrote:

> On Wed, Apr 23, 2008 at 2:24 AM, Lachlan Deck  
> <la...@gmail.com> wrote:
>> Okay - making progress...
>>
>> If I create a maven-archetype-j2ee-simple, cd into the dir, comment  
>> out the
>> site module from the parent pom and do 'mvn package' it all works  
>> without
>> having to install the sub-modules.
>>
>> However, with my structure it doesn't grab the jars from the sub- 
>> modules
>> for the app - but complains that they're not installed. The app (with
>> packaging = woapplication) fails to build.
>
> Does it fail because Maven cannot find a dependency? Or is it  
> another problem?

It fails saying that I should firstly download the dependency and  
manually install it - but it's one of the modules in the project.
My tree is like this:

/pom.xml
/myframeworks
/myframeworks/moduleA
...
/app1/pom.xml

It's a similar structure to the j2ee-simple example.

>> What am I missing? What's the 'trick' for making this work?
>>
> Have you tried "mvn clean install" in the parent module? The package
> goal doesn't install the jars into the your local repository.

I realise that it doesn't install stuff. But that's my point, the j2ee- 
simple project (which also has sub-modules of modules) didn't need to  
have the modules installed in order to simply do mvn package right out  
of the box, so to speak.

I'm wondering why it's different here. I'm trying to get away from the  
old woproject-ant based system where something has to be installed  
first prior to be able to build the application for testing/deployment.

> Have you declared the sub-module dependency in your application  
> pom.xml?

Yes.

with regards,
--

Lachlan Deck




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


Re: assembly help

Posted by Henrique Prange <hp...@gmail.com>.
Hi Lachlan,

On Wed, Apr 23, 2008 at 2:24 AM, Lachlan Deck <la...@gmail.com> wrote:
>  Okay - making progress...
>
>  If I create a maven-archetype-j2ee-simple, cd into the dir, comment out the
> site module from the parent pom and do 'mvn package' it all works without
> having to install the sub-modules.
>
>  However, with my structure it doesn't grab the jars from the sub-modules
> for the app - but complains that they're not installed. The app (with
> packaging = woapplication) fails to build.

Does it fail because Maven cannot find a dependency? Or is it another problem?

>
>  What am I missing? What's the 'trick' for making this work?
>

Have you tried "mvn clean install" in the parent module? The package
goal doesn't install the jars into the your local repository.

Have you declared the sub-module dependency in your application pom.xml?

Cheers,

Henrique

>  with regards,
>  --
>
>  Lachlan Deck
>
>
>
>

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


Re: assembly help

Posted by Lachlan Deck <la...@gmail.com>.
Hi again,

On 23/04/2008, at 5:14 AM, Henrique Prange wrote:

> What do you want to do exactly? It seems that you are trying to  
> package a WebObjects application. Have you tried the maven- 
> wolifecycle-plugin [1]?
>
> [1]http://wiki.objectstyle.org/confluence/display/WOL/WOProject-Maven2

Okay - making progress...

If I create a maven-archetype-j2ee-simple, cd into the dir, comment  
out the site module from the parent pom and do 'mvn package' it all  
works without having to install the sub-modules.

However, with my structure it doesn't grab the jars from the sub- 
modules for the app - but complains that they're not installed. The  
app (with packaging = woapplication) fails to build.

What am I missing? What's the 'trick' for making this work?

with regards,
--

Lachlan Deck




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


Re: assembly help

Posted by Lachlan Deck <la...@gmail.com>.
Hi Henrique,

On 24/04/2008, at 1:06 AM, Henrique Prange wrote:

> Hi Lachlan,
>
> On Tue, Apr 22, 2008 at 9:31 PM, Lachlan Deck  
> <la...@gmail.com> wrote:
>> My dependent frameworks are not of packaging woframework, but jar
>
> I think you really should try to use the woframework packaging. You
> will have to write much less configuration.

There was hardly any actually.

-- parent pom --
<?xml version="1.0" encoding="UTF-8"?>
<project ...>
   ...
   <build>
     <sourceDirectory>src</sourceDirectory>
     <testSourceDirectory>tests</testSourceDirectory>
     <resources>
       <resource>
         <targetPath>Resources</targetPath>
         <filtering>true</filtering>
         <directory>../src/main/resources</directory>
       </resource>
       <resource>
         <targetPath>Resources</targetPath>
         <filtering>false</filtering>
         <directory>Components</directory>
       </resource>
       <resource>
         <targetPath>Resources</targetPath>
         <filtering>false</filtering>
         <directory>Resources</directory>
       </resource>
       <resource>
         <targetPath>WebServerResources</targetPath>
         <filtering>false</filtering>
         <directory>WebServerResources</directory>
       </resource>
     </resources>
   </build>
</project>

Then all the child modules are quite short.

>> - so I can't see what options/configurations to provide to bundle  
>> the relevant dependent
>> jars (or indeed - what scope they should be).
>
> Why do you need the dependencies packaged inside a woframework jar?
> The dependencies are declared in the pom.xml. When you declare a
> woframework as dependency, Maven automatically adds the transitive
> dependencies to your project. For example, if you have a woframework
> that depends upon a library A. When you add this woframework to a
> project, Maven will add the dependency A transitively to your project.

Okay. Thanks for the explanation.

with regards,
--

Lachlan Deck


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


Re: assembly help

Posted by Henrique Prange <hp...@gmail.com>.
Hi Lachlan,

On Tue, Apr 22, 2008 at 9:31 PM, Lachlan Deck <la...@gmail.com> wrote:
>  The documentation, for WOProject-Maven2 is not very verbose however.

Yeah. The documentation is poor. :(

>My dependent frameworks are not of packaging woframework, but jar

I think you really should try to use the woframework packaging. You
will have to write much less configuration.

> - so I can't see what options/configurations to provide to bundle the relevant dependent
> jars (or indeed - what scope they should be).

Why do you need the dependencies packaged inside a woframework jar?
The dependencies are declared in the pom.xml. When you declare a
woframework as dependency, Maven automatically adds the transitive
dependencies to your project. For example, if you have a woframework
that depends upon a library A. When you add this woframework to a
project, Maven will add the dependency A transitively to your project.

Cheers,

Henrique

>  I've got the relevant repo and plugin repo declarations in my parent pom
> but I'm getting this in the app project:
>  Cannot find lifecycle mapping for packaging: 'woapplication'.
>  Component descriptor cannot be found in the component repository:
> org.apache.maven.lifecycle.mapping.LifecycleMappingwoapplication.
>
>
>
>  with regards,
>  --
>
>  Lachlan Deck
>
>
>
>
>  ---------------------------------------------------------------------
>  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: assembly help

Posted by Lachlan Deck <la...@gmail.com>.
Hi Henrique,

On 23/04/2008, at 5:14 AM, Henrique Prange wrote:

> What do you want to do exactly? It seems that you are trying to  
> package a WebObjects application.

Correct :-)

> Have you tried the maven-wolifecycle-plugin [1]?
>
> [1]http://wiki.objectstyle.org/confluence/display/WOL/WOProject-Maven2

I'm trying both.

The documentation, for WOProject-Maven2 is not very verbose however.  
My dependent frameworks are not of packaging woframework, but jar - so  
I can't see what options/configurations to provide to bundle the  
relevant dependent jars (or indeed - what scope they should be).

I've got the relevant repo and plugin repo declarations in my parent  
pom but I'm getting this in the app project:
Cannot find lifecycle mapping for packaging: 'woapplication'.
Component descriptor cannot be found in the component repository:  
org.apache.maven.lifecycle.mapping.LifecycleMappingwoapplication.

with regards,
--

Lachlan Deck




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


Re: assembly help

Posted by Henrique Prange <hp...@gmail.com>.
Hi Lachlan,

What do you want to do exactly? It seems that you are trying to package 
a WebObjects application. Have you tried the maven-wolifecycle-plugin [1]?

[1]http://wiki.objectstyle.org/confluence/display/WOL/WOProject-Maven2

Cheers,

Henrique

Lachlan Deck wrote:
> Hi there,
> 
> I'm still quite new to maven... so any demos appreciated :-)
> 
> I'm needing to create a directory-based assembly (ideally it would be 
> tgz or zipped up afterwards) - but I'm not quite sure how to go about 
> the following.
> 
> The project looks like this:
> /pom.xml
> frameworks/
>     pom.xml
>     moduleA
>     etc
> apps/
>     app1
>     etc
>     
> The apps need to be built as application bundles...e.g.,
> <finalName>.someExtension/
>     Dependencies/*.jar <!-- all but system/test scoped dependencies -->
>     Resources/Java/<finalName>.jar
>     etc
> 
> I also need to append to a textfile the list of dependencies prefixed by 
> a custom path (one entry per line).
> 
> Any examples/ideas?
> Thanks
> 
> with regards,
> -- 
> 
> Lachlan Deck
> 
> 
> ---------------------------------------------------------------------
> 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