sonatype/m2eclipse-tycho — Issue #4: Regression: IllegalArgumentException configuring project that uses tycho and bundle plugins
Author: martiell
Created: 2011-10-24 17:24:15+00:00
State: open

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.

```
An internal error occurred during: "Importing Maven projects".
java.lang.IllegalArgumentException
at org.sonatype.tycho.m2e.internal.OsgiBundleProjectConfigurator.generateBundleManifest(OsgiBundleProjectConfigurator.java:76)
at org.sonatype.tycho.m2e.internal.OsgiBundleProjectConfigurator.configureRawClasspath(OsgiBundleProjectConfigurator.java:178)
at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.invokeJavaProjectConfigurators(AbstractJavaProjectConfigurator.java:180)
at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.configure(AbstractJavaProjectConfigurator.java:128)
at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:72)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:302)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProject(ProjectConfigurationManager.java:234)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:150)
at org.eclipse.m2e.core.ui.internal.wizards.MavenImportWizard$1.doCreateMavenProjects(MavenImportWizard.java:164)
at org.eclipse.m2e.core.ui.internal.wizards.AbstractCreateMavenProjectsOperation.run(AbstractCreateMavenProjectsOperation.java:73)
at org.eclipse.m2e.core.ui.internal.wizards.MavenImportWizard$3.runInWorkspace(MavenImportWizard.java:249)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
```

```xml

4.0.0

test
test
1-SNAPSHOT
bundle

UTF-8
UTF-8

org.eclipse.tycho
tycho-packaging-plugin
0.13.0

timestamp
validate

build-qualifier

org.apache.felix
maven-bundle-plugin
2.3.5
true

bundle-manifest
process-classes

manifest

${unqualifiedVersion}.${buildQualifier}

META-INF

```

Furthermore, it fails to interpolate the Bundle-Version correctly:
After running `process-classes` through Eclipse, the manifest looks like this:

```
Manifest-Version: 1.0
Built-By: martin
Build-Jdk: 1.6.0_24
Bundle-Version: ${unqualifiedVersion}.${buildQualifier}
Tool: Bnd-1.43.0
Bundle-Name: test
Bnd-LastModified: 1319476527351
Created-By: Apache Maven Bundle Plugin
Bundle-ManifestVersion: 2
Bundle-SymbolicName: test
```

Using m2e-tycho 0.5, the version is correctly interpolated:

```
Manifest-Version: 1.0
Built-By: martin
Build-Jdk: 1.6.0_24
Bundle-Version: 1.201110241723
Tool: Bnd-1.43.0
Bundle-Name: test
Bnd-LastModified: 1319477010015
Created-By: Apache Maven Bundle Plugin
Bundle-ManifestVersion: 2
Bundle-SymbolicName: test
```