You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Kasper Nielsen <ka...@gmail.com> on 2012/06/06 23:08:50 UTC

Using maven felix plugin with maven shade plugin

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

just fails with

Failed to execute goal
org.apache.felix:maven-bundle-plugin:2.3.7:manifest (default-cli) on
project test-felix: Cannot find C:\test\test-felix\target\classes
(manifest goal must be run after compile phase) -> [Help 1]

Cheers
   Kasper

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


Re: Using maven felix plugin with maven shade plugin

Posted by Peter Penzov <pe...@gmail.com>.
Would you paste the POM.xml file?

On Thu, Jun 7, 2012 at 12:08 AM, Kasper Nielsen <ka...@gmail.com> 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
>
> just fails with
>
> Failed to execute goal
> org.apache.felix:maven-bundle-plugin:2.3.7:manifest (default-cli) on
> project test-felix: Cannot find C:\test\test-felix\target\classes
> (manifest goal must be run after compile phase) -> [Help 1]
>
> Cheers
>   Kasper
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Using maven felix plugin with maven shade plugin

Posted by Kasper Nielsen <ka...@gmail.com>.
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: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Using maven felix plugin with maven shade plugin

Posted by Stuart McCulloch <mc...@gmail.com>.
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

> just fails with
> 
> Failed to execute goal
> org.apache.felix:maven-bundle-plugin:2.3.7:manifest (default-cli) on
> project test-felix: Cannot find C:\test\test-felix\target\classes
> (manifest goal must be run after compile phase) -> [Help 1]
> 
> Cheers
>   Kasper
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


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