On 6/6/06, EJ Ciramella <[EMAIL PROTECTED]> wrote:
Yeah, I bound this to the verify stage properly, but the outstanding
question is how can the directory structure get passed from the parent
pom to the child?
When the parent pom calls the child one, everything is supposed to be
based on the child's pom location. Instead, the parent pom is looking
for a target directory at the same level as the child (I'm using the
assembly plugin). Of course this fails.
Is there a way to do this?
I can't do much but throw some suggestions, I'm not at the stage of
having done this myself yet.
1) POM Inheritence vs Aggregation
The problem might be the difference between inheritence and
aggregation and that because you are using the same pom for both you
are getting these issues. Read
http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html
You might want to split you parent pom into two, one for inheritance
of common values and one for aggregation.
Or you might want to remove this completely from the parent and
duplicate it in the child.
Get it working there first, and then look at how to push it up and
make it common.
2) POM plugins vs pluginManagement
You might also want to look the difference between plugins and pluginManagement.
If you inherit the parent pom you get all the plugins defined and they
probably have their directories resolved to the parent basedir. But
if you put your declaration in pluginManagement then you are providing
a common configuration but not instantiating it yet. Then in your
child pom in the plugin section specify you want to use a plugin but
you dont have to configure it since it will inherit the values from
the parent.
In the child this should be enough, and it should resolve to the child
pom's src/main/assembly/dep.xml
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
3) Creating TAR from a pom with jar packaging.
This is what we do for creating distribution from the pom:
(In the child pom, the parent pom does not have any of this information)
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
</plugin>
Where our bin.xml is:
<assembly>
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory></outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
</assembly>
Note that we are using "directory" instead of another format for now
as we want to test the distribution in place without having to
unarchive yet. Once we have got it working we will change the format.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]