Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Project no longer builds in Eclipse after upgrading to m2e 1.4

Can you provide a small standalone example project that builds on
command line but fails inside m2e workspace?

Generally, I do not believe it is possible to use tycho-packaging-plugin
build-qualifier goal for non-tycho projects. I thought I filed a Tycho
enhancement request about this, but can't find it any more, maybe it was
closed for the lack of interest.

To manage OSGi version qualifier of maven-bundle-plugin (m-b-p for
short) projects I usually set <_snapshot> bnd instruction to
"${maven.build.timestamp}" for regular command line builds and
".qualifier" when working on the projects inside m2e. The latter is
needed because m2e doesn't/can't maintain ${maven.build.timestamp}
property. You can see complete working configuration example in [1].

[1] http://git.eclipse.org/c/m2e/m2e-core.git/tree/m2e-maven-runtime/pom.xml?id=releases/1.4/1.4.0.20130601-0317

--
Regards,
Igor

On 2013-08-08 3:32 AM, Martin Ellis wrote:
Hi,

I'm trying to understand why my project no longer builds in Eclipse
after upgrading to m2e 1.4.

The project consists of several OSGi bundles, built using the Felix
maven-bundle-plugin, all in a reactor.

They are later picked up and used by a Tycho build for use in an
Eclipse plugin. In order to ensure that these bundles are updated when
upgrading the Eclipse plugin, I have added a build qualifier to the
bundle-plugin builds:

         <plugin>
           <groupId>org.eclipse.tycho</groupId>
           <artifactId>tycho-packaging-plugin</artifactId>
           <version>${tycho.version}</version>
           <executions>
             <execution>
               <id>timestamp</id>
               <phase>validate</phase>
               <goals>
                 <goal>build-qualifier</goal>
               </goals>
             </execution>
           </executions>
         </plugin>

Then used the ${unqualifiedVersion} and ${buildQualifier} set by the
build-qualifier goal in the Bundle-Version as follows:

         <plugin>
           <groupId>org.apache.felix</groupId>
           <artifactId>maven-bundle-plugin</artifactId>
           <extensions>true</extensions>
           <configuration>
             <manifestLocation>META-INF</manifestLocation>
             <instructions>
               <Bundle-Version>${unqualifiedVersion}.0.${buildQualifier}</Bundle-Version>
             </instructions>
           </configuration>
         </plugin>

Previously, I had used a lifecycle mapping to ensure that the
build-qualifier goal was run by m2e:

         <plugin>
           <groupId>org.eclipse.m2e</groupId>
           <artifactId>lifecycle-mapping</artifactId>
           <version>1.0.0</version>
           <configuration>
             <lifecycleMappingMetadata>
               <pluginExecutions>
                 <pluginExecution>
                   <pluginExecutionFilter>
                     <groupId>org.eclipse.tycho</groupId>
                     <artifactId>tycho-packaging-plugin</artifactId>
                     <versionRange>[0.13.0,)</versionRange>
                     <goals>
                       <goal>build-qualifier</goal>
                     </goals>
                   </pluginExecutionFilter>
                   <action>
                     <execute />
                   </action>
                 </pluginExecution>
               </pluginExecutions>
             </lifecycleMappingMetadata>
           </configuration>
         </plugin>

However, after updating to m2e, I am seeing the following error in my
Eclipse log:

   Invalid value for Bundle-Version,
${unqualifiedVersion}.0.${buildQualifier} does not match
[0-9]+(\.[0-9]+(\.[0-9]+(\.[0-9A-Za-z_-]+)?)?)?

I don't understand why these properties are no longer being interpolated.

Is there a better way to get a build qualifier timestamp that's
consistent across projects in a reactor, and that also works in m2e?

Please let me know if a test project would help.

Thanks
Martin
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top