greydet
greydet

Reputation: 5539

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

I am trying to build several Eclipse plug-ins with Maven Tycho. All the plug-ins does not have the same version number.

Let's say the following pom architecture:

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.

Upvotes: 3

Views: 5633

Answers (4)

Saran
Saran

Reputation: 167

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>

Upvotes: 1

jurevert
jurevert

Reputation: 878

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

Upvotes: 2

jsievers
jsievers

Reputation: 1853

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

Upvotes: 11

greydet
greydet

Reputation: 5539

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?

Upvotes: 1

Related Questions