开发者

How to build plugins having different versions from a single parent pom.xml?

开发者 https://www.devze.com 2023-03-18 07:49 出处:网络
I am trying to build several Eclipse plug-ins with Maven Tycho. All the plug-ins does not have the same versio开发者_Go百科n number.

I am trying to build several Eclipse plug-ins with Maven Tycho. All the plug-ins does not have the same versio开发者_Go百科n number.

Let's say the following pom architecture:

  • plugin1 (version 1.0.6.qualifier) / pom.xml
  • plugin2 (version 1.4.0.qualifier) / pom.xml
  • pom.xml (parent pom version 1.0.0.SNAPSHOT)

Maven's build fails with the following error:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.12.0:validate-version (default-validate-version) on project plugin1: Unqualified OSGi version 1.0.6.qualifier must match unqualified Maven version 1.0.0-SNAPSHOT for SNAPSHOT builds

How to configure the parent pom to be able to build those plug-ins with different version numbers? Should I use a different pom architecture to solve this issue?

Note that I don't want to modify plug-in's versions.


maven POM version and MANIFEST version must match (with suffix ".qualifer" in MANIFEST replaced by "-SNAPSHOT" in pom.xml).

See http://wiki.eclipse.org/Tycho/Packaging_Types#eclipse-plugin


You can configure tycho plugin like that in order to only Warn versions problems : http://www.eclipse.org/tycho/sitedocs/tycho-packaging-plugin/validate-version-mojo.html

<plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-packaging-plugin</artifactId>
            <configuration>
                <strictVersions>false</strictVersions>
            </configuration>
        </plugin>
    </plugins>

Result :

[INFO] --- tycho-packaging-plugin:0.16.0:validate-version (default-validate-version) @ org.apache.commons.io ---
[WARNING] Unqualified OSGi version 5.1.0.qualifier must match unqualified Maven version 2.1.0-SNAPSHOT for SNAPSHOT builds


I found a solution. I added a version tag corresponding to the Eclipse plug-in version in each modules' pom.xml.

Is it possible to use maven pom.xml files without any version tag and let tycho using version specified in MANIFEST.MF files?


Even i have faced the same problem and found the solution for the same.

Actually the problem is Manifest.MF file version and pom.xml parent version should be same otherwise we will get this error.

Manifest.MF Bundle-Version: 2.5.0.qualifier

pom.xml

<parent>
    <groupId>com.example.pma</groupId>
    <artifactId>com.example.pma.product.parent</artifactId>
    <version>2.5.0-SNAPSHOT</version>
    <relativePath>../com.example.pma.product.parent</relativePath>
</parent>
0

精彩评论

暂无评论...
验证码 换一张
取 消