Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] any way tycho to change the .qualifier of POM-FIrst bundles when generating a P2 ?

Michael,

below is the snipts. It is working well for generate the source artifacts.

Unfortunately there is a Tycho bugs [1] and [2]  that I thinking is messing with generated P2... So, I can't use the generated P2 when there are those POM-FIRST source features in its category file.

Are you generating a P2 with any Source Feature ? 

<build.timestamp>${maven.build.timestamp}</build.timestamp>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<unpackBundle>true</unpackBundle>
<instructions>
<Bundle-SymbolicName>${project.artifactId};singleton:=true</Bundle-SymbolicName>
... <Embed-Transitive>true</Embed-Transitive>
<Embed-Directory>jars</Embed-Directory>
<_nouses>true</_nouses>
<_sources>false</_sources>
<_snapshot>${build.timestamp}</_snapshot>
</instructions>
</configuration>
</plugin>
<!-- Build helper maven plugin sets the parsedVersion.osgiVersion property -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
</plugin>
<!-- enable source bundle generation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId&g t;
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
<configuration>
<excludeResources>true</excludeResources>
<excludes>
<exclude>**/jars/**</exclude>
</excludes>
<archive>
<manifestEntries>
<Bundle-ManifestVersion >2</Bundle-ManifestVersion>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-SymbolicName>${project.artifactId}.source</Bundle-SymbolicName>
<Bundle-Vendor>${organization.name}</Bundle-Vendor>
<Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
<Eclipse-SourceBundle>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}";roots:="."</Eclipse-SourceBundle>
</manifestEntries>
</archive>
</configuration>
</plugin>


[1] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=361149
[2] - https://bugs.eclipse.org/bugs/show_bug.cgi?id=368596

regards,

Cristiano


On 29/02/12 08:26, Cristiano Gavião wrote:
Hi Michael,

I got it working now...

the solution was to get ${maven.build.timestamp} in a property variable and share it with both build-helper-maven-plugin and maven-bundle-plugin...

thanks again

Cristiano

On 28/02/12 16:07, Cristiano Gavião wrote:
Hi Michael,

Thank for sharing...

well, besides the fact the m2e have complained when I add the <_snapshot> into pom, I could run it using mvn and it changed the artifact symbolic name properly...

But doing this I've broken the source bundle generation with maven-source-plugin, because I couldn't make build-helper-maven-plugin to get the symbolic name used by maven-bundle-plugin.

I've tried drop maven-source-plugin and follow you adding <_sources>true</_sources>. But maven-bundle-plugin doesn't create another bundle for source, so I can't reference it in a source feature xml file.

still investigating alternatives...

regards,

Cristiano


On 28/02/12 14:12, Michael Gruebsch wrote:
Hi,

try using

<_snapshot>${maven.build.timestamp}</_snapshot>

in the instruction section of the maven-bundle-plugin

e.g.

<artifactId>...</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>

   ...

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>...</Bundle-SymbolicName>
<Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
<Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Directory>jars</Embed-Directory>
<_exportcontents>*</_exportcontents>
<_sources>true</_sources>

<_snapshot>${maven.build.timestamp}</_snapshot>

</instructions>
</configuration>
</plugin>

see http://www.aqute.biz/Bnd/Format for further references.

Michael



Message: 5
Date: Tue, 28 Feb 2012 11:21:04 -0300
From: Cristiano Gavi?o<cvgaviao@xxxxxxxxx>
To: Tycho user list<tycho-user@xxxxxxxxxxx>
Subject: [tycho-user] any way tycho to change the .qualifier of
    POM-FIrst bundles when generating a P2 ?
Message-ID:<4F4CE2D0.5090309@xxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi,

I have a p2 that contain both POM-First and Manifest-First bundles.

when I create a snapshot version I could see that only the bundles
created by tycho have it generated symbolic name .qualifier
changed for
a timestamp. all pom-first stay as was created, with .SNAPSHOT.

The POM-First is being created by maven-bundle-plugin, so its
default is
to create it snapshot bundles with .SNAPSHOT instead a .qualifier.

But even when I configure maven-bundle-plugin to generate a
bundle name
using .qualifier instead the default I could not have the
expected result.

please, could someone give me a light?

regards,

Cristiano
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




Back to the top