-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: IllegalArgumentException configuring project that uses tycho and bundle plugins #4
Comments
Note: when using the m2eclipse-tycho configurator you don't need the extra execution to place the bnd-generated manifest under /META-INF/. If you remove the "bundle-manifest" execution you should be able to import the project. Of course the configurator should probably be more robust and ignore / provide a better warning about the extra execution. |
Also, the issue about the Bundle-Version is caused by the instructions being tied to the manifest execution rather than the main plugin configuration. If you move the instructions up after removing the execution then you should get the interpolated version as expected. |
So... how can I get the timestamp in the Bundle-Version? I have an Eclipse plugin with some pom-first dependencies. |
(Sorry, your second reply took a while to arrive) Here's what I have now: <plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>0.13.0</version>
<executions>
<execution>
<id>timestamp</id>
<phase>validate</phase>
<goals>
<goal>build-qualifier</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Version>${unqualifiedVersion}.${buildQualifier}</Bundle-Version>
</instructions>
</configuration>
</plugin> Even after "Update Project Configuration" and a clean, the version is still not interpolated correctly:
|
Not entirely sure how the 0.13.0 tycho-packaging-plugin is supposed to play with the new configurator, but if you want to amend the qualifier to add a timestamp then you can use bnd macros. Also note that since the new configurator should work better wrt. inter-project dependencies, you might find that you don't actually need to the timestamp in the qualifier anymore (although it can still be useful if you're deploying outside of Eclipse). Example using bnd macros to replace SNAPSHOT with a simple timestamp ( see http://www.aqute.biz/Bnd/Macros ) <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.report.outputEncoding>UTF-8</project.report.outputEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.5</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Version>$(replace;$(project.version);SNAPSHOT;$(tstamp))</Bundle-Version>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project> |
Thanks for the bnd tip. I'm a bit worried about using two different sources of timestamps. I'm not sure if that has any implications, but I'll give it a go tomorrow. I don't follow your point about inter-project dependencies. To reiterate: the reason I'm using the build qualifier is to make it easier to install and update snapshot versions in an Eclipse installation. Typically I'll install a snapshot of our plugin my main Eclipse installation every few days (dogfood, and all that). If the Bundle-Version doesn't have a build qualifier timestamp, then the bundle doesn't get updated when the feature is upgraded. (So I want the build qualifier regardless.) |
Hi Stuart, I've made the changes you suggest, but am getting CNFEs when I try to run the plugin and bundles. Martin |
On 25 Oct 2011, at 13:44, Martin [email protected] wrote:
If you can trace the CNFE to missing imports in the manifests created by the bundleplugin then it's probably better to use the Felix list - can you point me to the source or provide a testcase? You might also want to try the 2.4.0-SNAPSHOT of the bundleplugin as it includes an update to bnd and other fixes.
|
I think the manifests are OK. The maven build works, and the plugins are installable. It's just the upgrade to m2e-tycho 0.6 I'm struggling with. I'll try to put together a test case. |
I'm getting this problem too. It seems to have the knock on effect of preventing the project from being seen as part of the workspace in the OSGi run configurations. - Meaning you can't use the built in OSGi run and debug support in eclipse. I've tried all day to find a work around and simply can't. @martiell - I'm also using m2e-tycho 0.6. I can also confirm that if I remove the maven-bundle-plugin I don't get this exception. However, I also don't get a built bundle! |
@BohoCode can you provide a test project? Also make sure you're using the latest maven-bundle-plugin (2.3.7) and the latest m2eclipse-tycho (https://repository.sonatype.org/content/repositories/forge-sites/m2eclipse-tycho/0.6.0/N/0.6.0.201202131819/) |
@BohoCode I use the following in the parent pom for pom-first (i.e. maven-bundle-plugin) projects. The trick seems to be configuring the lifecycle mapping to execute the build-qualifier goal on pom-first projects (but not manifest-first projects).
|
Thanks @martiell - that worked for me. No more import exceptions. |
@mcculls - I'll try and get a test project somewhere, but it's very hard to post code from work! May have to wait until I can set something up from home. |
This bug is quite old but I had the same problem today. For me the solution was to set the packaging type in the pom to |
I had same issue while importing current Apache Avro svn trunk (1.8.0-SNAPSHOT) into Eclipse (4.4) with m2e (1.5.0) and Tycho Project Configurators (0.7.0). |
Hi, I get a similar error when using the org.sonatype.tycho.m2e plugin version 0.7.0.20130929: pom is: any ideas how to fix this bug? |
According to the issue reported in the following link tesla/m2eclipse-tycho#4 , m2eclipse plugin doesn't need extra execution step to place the generated manifest under /META-INF/. The configurator of the m2eclipse plugin does not ignore this step which generates illegalArgumentException during the create/ import of the AEM project in/to Eclipse.
Removed executions tag and its subtags.According to this [issue](tesla/m2eclipse-tycho#4), this extra execution step interferes with m2eclipse plugin configurator. the plugin does not ignore this step which generates illegalArgumentException during the create/import of the AEM project in/to Eclipse.
This also fixes adobe/aem-eclipse-developer-tools#78 Removed executions tag and its subtags. According to [1] this extra execution step interferes with m2eclipse plugin configurator. the plugin does not ignore this step which generates illegalArgumentException during the create/import of the AEM project in/to Eclipse. [1]: tesla/m2eclipse-tycho#4
The pom below can be imported and used with m2e-tycho 0.5.0.201108311102.
However, m2e-tycho 0.6.0.201110151902 fails to import the project with the following error.
Furthermore, it fails to interpolate the Bundle-Version correctly:
After running
process-classes
through Eclipse, the manifest looks like this:Using m2e-tycho 0.5, the version is correctly interpolated:
The text was updated successfully, but these errors were encountered: