I would approach this as an acceptable use of a profile.  Make a profile with 
these dependencies defined.  If you activate the profile, they will all be 
added.  If you don’t activate the profile, none will be added.

This should fix your issues.

Thanks,

Roy Lyons
Senior Configuration Engineer

From: Stefan Rademacher <rademac...@hhla.de<mailto:rademac...@hhla.de>>
Reply-To: "'users@maven. org'" 
<users@maven.apache.org<mailto:users@maven.apache.org>>
Date: Friday, October 12, 2012 6:52 AM
To: "'users@maven. org'" <users@maven.apache.org<mailto:users@maven.apache.org>>
Subject: Antw: Re: Re: Corrupted Assembly, when using a type:pom dependency

Hi Curtis,

yes, that's right. I want do declare a set of dependencies, which always must 
be used "all" or "none". That why I encapsulate those dependencies in a 
separate pom and reference it with a type=pom dependency.

I didn't know about this scope "import" before and found your link very 
infomative! Thanks!
Unfortunately, the assembly still gets corrupted, as soon as I have a type=pom 
dependency in my configuration... with or without scope=import.

Any other suggestions?

Regards,
Stefan


>>> Curtis Rueden <ctrue...@wisc.edu<mailto:ctrue...@wisc.edu>> 11.10.2012 
>>> 18:05 >>>
Hi Stefan,

> <dependency>
>    <groupId>de.hhla.test</groupId>
>    <artifactId>test.assembly.core</artifactId>
>    <version>0.0.1-SNAPSHOT</version>
>    <type>pom</type>
> </dependency>

Personally, I have never used a dependency of type pom. But according to
the Maven docs, the main use case for it is as a shortcut to import a group
of dependencies transitively from that POM project. But in that case, you
would declare that dependency with scope "import"; see:

http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies

Is that what you are trying to do? If you use scope import, does the
problem go away? If scope import is not what you want, I am curious why you
are using a dependency of type pom.

Regards,
Curtis


On Thu, Oct 11, 2012 at 3:53 AM, Stefan Rademacher 
<rademac...@hhla.de<mailto:rademac...@hhla.de>>wrote:

>  Sorry, I didn't notice, that my original posting wasn't attached to my
> last email.
> Here is again, what I asked few weeks ago. Can anyone help me with this?
> ---
>
> Hi all,
>
> I want to create an assembly, using a moduleSet. With the following
> (simplified) example, I select a certain artifact, define the output directory
> and provide a naming pattern.
> <assembly>
>  <id>distribution</id>
>  <formats>
>   <format>zip</format>
>  </formats>
>  <moduleSets>
>   <moduleSet>
>    <useAllReactorProjects>true</useAllReactorProjects>
>    <includes>
>     <include>${artifact.groupId}:test.assembly.server</include>
>    </includes>
>    <binaries>
>     <outputDirectory>.</outputDirectory>
>     <unpack>false</unpack>
>     <outputFileNameMapping>${module.artifactId}.${module.extension}
>     </outputFileNameMapping>
>    </binaries>
>   </moduleSet>
>  </moduleSets>
> </assembly>
>
> The module I select in this assembly.xml contains one dependency:
> <dependency>
>    <groupId>de.hhla.test</groupId>
>    <artifactId>test.assembly.core</artifactId>
>    <version>0.0.1-SNAPSHOT</version>
>    <type>pom</type>
> </dependency>
>
> The resulting assembly is unusable, as soon as the following two conditions 
> are
> true:
> - The module has a dependency with <type>pom</type>
> AND
> - The outputDirectory of the moduleSet is "."
>
> In this case, the resulting assembly (e. g. zip file) looks like this:
> ZIP
> |
> |-- ""
> |    |-- test.assembly.server.jar
> |
> |-- test.assembly.server.jar
>
> The file "test.assembly.server.jar", which is contained in that directory with
> an empty name, is not actually a jar, but the POM of the dependency, which I
> specified with <type>pom</type> !!! That's totally weird, isn't it?
> Extracting this zip structure leads to a corrupted "test.assembly.server.jar",
> because the first jar in the dir with no name (which actually is an XML file)
> overwrites the correct jar at the actual root level of the zip file.
>
> Another hint is this debug output of the assembly plugin:
> [DEBUG] Adding file: C:\Dokumente und
> Einstellungen\<user>\.m2\repository\de\hhla\test\test.assembly.core\0.0.1-SNAPSHOT\test.assembly.core-0.0.1-SNAPSHOT.pom
>  to archive location: TEST_0.0.1-SNAPSHOT//test.assembly.server.jar
> (Please notice the two slashes in the destination path.)
>
> Is this already a known issue or should I file a bug?
>
> Thanks and best regards,
> Stefan
>
> ---
>
> Thanks and best regards
> Stefan
>
>
> >>> tobias maslowski 
> >>> <tobiasmaslow...@gmail.com<mailto:tobiasmaslow...@gmail.com>> 08.10.2012 
> >>> 11:45 >>>
>
> You probably should provide some information about your problem, like what
> you tried to do, the setup ...
>
> Anyway there are a few issues in the tracker, maybe you stumbled accross
> http://jira.codehaus.org/browse/MASSEMBLY-609?
>
> 2012/10/8 Stefan Rademacher <rademac...@hhla.de<mailto:rademac...@hhla.de>>
>
> >  Hi,
> >
> > is there nobody, who can confirm, if this is a known issue?
> >
> > Thanks,
> > Stefan
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: 
> > users-unsubscr...@maven.apache.org<mailto:users-unsubscr...@maven.apache.org>
> > For additional commands, e-mail: 
> > users-h...@maven.apache.org<mailto:users-h...@maven.apache.org>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> users-unsubscr...@maven.apache.org<mailto:users-unsubscr...@maven.apache.org>
> For additional commands, e-mail: 
> users-h...@maven.apache.org<mailto:users-h...@maven.apache.org>
>

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

Reply via email to