Hi Valerio,

this look like a problem with the jarjar ant task itself and not maven related.
Have you tried adding a "zap" to remove maven entries in the jar:
<configuration>
...
  <zaps>
    <zap>META-INF/maven/**</zap>
  <zaps>
...
</configuration>

This might not be ideal, but it should remove the duplicate entries.
Once this works you can try to be more specific about what you want to
exclude.

SaM

PS: I don't have a Jira project for the jarjar-maven-plugin, but will
let you know as soon as I have one.

On Sat, Oct 11, 2008 at 10:56 AM, Valerio Schiavoni
<[EMAIL PROTECTED]> wrote:
> Hello SaM,
>
> a small progress now but still no success. I'm hitting against an
> IllegalArgumentException due to multiple LICENSE.txt found in the
> dependencies being imported..
>
> Here's the stacktrace:
>
> [INFO] [jarjar:jarjar {execution: default}]
> Copying 1 file to /Users/veleno/workspace/simplep2psim/target
> Building jar:
> /Users/veleno/workspace/simplep2psim/target/simplep2psim-0.2.jar
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] java.lang.IllegalArgumentException: Duplicate jar entries:
> META-INF/maven/org.objenesis/objenesis/pom.properties
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> : java.lang.IllegalArgumentException: Duplicate jar entries:
> META-INF/maven/org.objenesis/objenesis/pom.properties
>     at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
>     at org.apache.tools.ant.Task.perform(Task.java:348)
>     at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:199)
>     at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:153)
>     at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:149)
>     at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
>     at
> org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:784)
>     at
> org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:758)
>     at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
>     at
> com.atlassian.maven.plugins.jarjar.JarJarMojo.execute(JarJarMojo.groovy:80)
>     at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:924)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:762)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:529)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>     at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>     at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: java.lang.IllegalArgumentException: Duplicate jar entries:
> META-INF/maven/org.objenesis/objenesis/pom.properties
>     at
> com.tonicsystems.jarjar.ext_util.StandaloneJarProcessor.run(StandaloneJarProcessor.java:60)
>     at com.tonicsystems.jarjar.MainProcessor.strip(MainProcessor.java:65)
>     at com.tonicsystems.jarjar.JarJarTask.execute(JarJarTask.java:51)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>     ... 31 more
> --- Nested Exception ---
> java.lang.IllegalArgumentException: Duplicate jar entries:
> META-INF/maven/org.objenesis/objenesis/pom.properties
>     at
> com.tonicsystems.jarjar.ext_util.StandaloneJarProcessor.run(StandaloneJarProcessor.java:60)
>     at com.tonicsystems.jarjar.MainProcessor.strip(MainProcessor.java:65)
>     at com.tonicsystems.jarjar.JarJarTask.execute(JarJarTask.java:51)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>     at org.apache.tools.ant.Task.perform(Task.java:348)
>     at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:199)
>     at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:153)
>     at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:149)
>     at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
>     at
> org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:784)
>     at
> org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:758)
>     at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
>     at
> com.atlassian.maven.plugins.jarjar.JarJarMojo.execute(JarJarMojo.groovy:80)
>     at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:924)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:762)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:529)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>     at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>     at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>
>
> PS: if you prefer to have these problems being tracked somewhere on JIRA,
> just let me know.
>
>
> On Sat, Oct 11, 2008 at 12:20 AM, Samuel Le Berrigaud <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi Valerio,
>>
>> you have to add the execution so that the plugin takes part in the
>> normal lifecyle of your project. Running the mojo has to happen on the
>> package phase as it works on the maven generated jar.
>>
>> So your configuration would look like:
>>
>> <plugin>
>>  <groupId>com.atlassian.maven.plugins</groupId>
>>  <artifactId>jarjar-maven-plugin</artifactId>
>>  <version>1.0-SNAPSHOT</version>
>>  <configuration>
>>    <projectPackage>gossip.simulator</projectPackage>
>>  </configuration>
>>  <executions>
>>    <execution>
>>      <goals><goal>jarjar</goal></goals>
>>    <execution>
>>  <executions>
>> </plugin>
>>
>> Then running: mvn package on your project should be sufficient.
>>
>> SaM
>>
>> On Sat, Oct 11, 2008 at 8:29 AM, Valerio Schiavoni
>> <[EMAIL PROTECTED]> wrote:
>> > hello Samuel,
>> >
>> > now the plugin successfully got installed. I'm getting a NPE like the
>> > following:
>> >
>> > [INFO] Trace
>> > java.lang.NullPointerException
>> >     at
>> >
>> > org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:178)
>> >     at
>> >
>> > org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:477)
>> >     at
>> >
>> > com.atlassian.maven.plugins.jarjar.JarJarMojo.execute(JarJarMojo.groovy:79)
>> >     at
>> >
>> > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>> >     at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>> >     at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>> >     at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>> >     at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>> >     at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>> >     at
>> >
>> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>> >     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>> >     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>> >     at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>> >     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> >     at
>> >
>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> >     at
>> >
>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> >     at java.lang.reflect.Method.invoke(Method.java:585)
>> >     at
>> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> >     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> >     at
>> > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> >     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> >
>> >
>> > Maybe i haven't configured the plugin properly:
>> >
>> > <plugin>
>> >         <groupId>com.atlassian.maven.plugins</groupId>
>> >            <artifactId>jarjar-maven-plugin</artifactId>
>> >            <version>1.0-SNAPSHOT</version>
>> >             <configuration>
>> >
>> > <projectPackage>gossip.simulator.Simulator</projectPackage>
>> >             </configuration>
>> >   </plugin>
>> >
>> > How should I translate the following rules.txt that I currently use so
>> > that
>> > the plugin understand it:
>> > keep gossip.simulator.Simulator
>> > keep gossip.simulator.protocol.*
>> > keep gossip.simulator.collectors.*
>> > keep gossip.simulator.evolvers.*
>> > keep gossip.simulator.initializers.*
>> >
>> > Reading the doc here
>> > http://docs.atlassian.com/jarjar-maven-plugin/jarjar-mojo.html I thought
>> > that the projectPackage would be sufficient.
>> >
>> > Thanks !
>> > valerio
>> >
>> >
>> > On Fri, Oct 10, 2008 at 2:35 PM, Samuel Le Berrigaud
>> > <[EMAIL PROTECTED]>
>> > wrote:
>> >>
>> >> Hi Valerio,
>> >>
>> >> indeed. I didn't realise that it relied on some of Atlassian's
>> >> libraries. You should be able to access them using this repository:
>> >> https://maven.atlassian.com/repository/public/ to your settings.
>> >>
>> >> I also uploaded a minimal doc at
>> >> http://docs.atlassian.com/jarjar-maven-plugin/
>> >>
>> >> There is definitely more work to be done though. Let me know how you go
>> >> with it.
>> >>
>> >> SaM
>> >>
>> >> On Fri, Oct 10, 2008 at 6:37 PM, Valerio Schiavoni
>> >> <[EMAIL PROTECTED]> wrote:
>> >> > Hello SaM and thanks for this pointer.
>> >> > I've tried to install it, but there are problems with unreleased POMs
>> >> > which
>> >> > are referenced by the mojo pom or by its parent.
>> >> >
>> >> > Namely, atlassian-base-pom, atlassian-public-pom,
>> >> > atlassian-contrib-pom,
>> >> >
>> >> > org.apache.maven.wagon:wagon-webdav-jackrabbit:jar:1.0-beta-4-patched,
>> >> > and
>> >> > probably others..i've stopped here because it was getting
>> >> > frustrating.
>> >> >
>> >> > If you're able to make the installation process a little bit more
>> >> > smooth
>> >> > (for instance: by posting which repository I need to add in my
>> >> > settings.xml), I'd be glad to give it another chance :-)
>> >> >
>> >> > cheers,
>> >> > valerio
>> >> >
>> >> > On Thu, Oct 9, 2008 at 12:40 AM, Samuel Le Berrigaud
>> >> > <[EMAIL PROTECTED]>
>> >> > wrote:
>> >> >>
>> >> >> Hey guys,
>> >> >>
>> >> >> I started working on something you might find usefull yesterday. You
>> >> >> can check it out at:
>> >> >>
>> >> >>
>> >> >>
>> >> >> https://svn.atlassian.com/svn/public/atlassian/maven-plugins/jarjar-maven-plugin/
>> >> >>
>> >> >> This is a JarJar plugin for maven2.
>> >> >> It would need some tests and documentation, but it should work. Let
>> >> >> me
>> >> >> know what you think.
>> >> >>
>> >> >> SaM.
>> >> >>
>> >> >> On Wed, Oct 8, 2008 at 10:55 PM, Valerio Schiavoni
>> >> >> <[EMAIL PROTECTED]> wrote:
>> >> >> > It would be useful for us, since the minijar mojo doesn't work
>> >> >> > well
>> >> >> > with
>> >> >> > MANIFEST files, alas the jarjar does.
>> >> >> >
>> >> >> > On Fri, Aug 11, 2006 at 12:08 AM, John Casey
>> >> >> > <[EMAIL PROTECTED]>
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> This is something that I started writing quite a long time
>> >> >> >> ago...I
>> >> >> >> don't
>> >> >> >> know whether anyone has taken up development on it since then,
>> >> >> >> but
>> >> >> >> if
>> >> >> >> not
>> >> >> >> then it isn't remotely functional.
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > http://www.linkedin.com/in/vschiavoni
>> >> >> > http://jroller.com/vschiavoni
>> >> >> >
>> >> >>
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe from this list, please visit:
>> >> >>
>> >> >>    http://xircles.codehaus.org/manage_email
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > http://www.linkedin.com/in/vschiavoni
>> >> > http://jroller.com/vschiavoni
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe from this list, please visit:
>> >>
>> >>    http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > http://www.linkedin.com/in/vschiavoni
>> > http://jroller.com/vschiavoni
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>
>
> --
> http://www.linkedin.com/in/vschiavoni
> http://jroller.com/vschiavoni
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to