On 06-06-2012 23:18, Stuart McCulloch wrote:
On 6 Jun 2012, at 22:08, Kasper Nielsen wrote:

Hi,

I'm trying to use the felix plugin to generate a manifest for a maven
shaded jar.
However I'm a bit lost since I never compile anything to
target/classes. The maven shade plugin just creates a new jar
combining all my dependencies.

mvn org.apache.felix:maven-bundle-plugin:manifest
^ note: here you're running a single goal outside of the project lifecycle so 
the project has no attached file, and as there is no target/classes either it 
doesn't have anything to analyze

If you add the manifest goal as an execution in the pom.xml so it runs after 
the shade plugin then it should find the attached shaded jar and produce a 
manifest for that:

    
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Plugins
Ahh thanks, this makes sense.

My only problem now is that the manifest is generated after the shaded jar is created (into target\classes\META-INF\MANIFEST.MF)
How do I replace the manifest in the shaded jar?

I cannot use
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>

because when the jar plugin is invoked the manifest file has not yet been created.

Cheers
  Kasper




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to