Question

I'm building my eclipse plugin by using Tycho(0.19).

In MENIFEST.MF My plugin ID is 1.0.0.qualifier, In pom file for same plgugin there is no version because master pom has version 1.0.0-SNAPSHOT (Even I tried to put version in plugin also but same result)

When I ran the build I'm getting my plugin as PLUGIN_NAME.1.0.0.SNAPSHOT.jar

Ques: Why in build jar file SNAPSHOT is not replacing with timestamp ?. What I'm missing..?


Master POM

<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>my.group</groupId>
    <artifactId>plugin.releng</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <build>
        <plugins>
              <plugin>
                  <groupId>org.eclipse.tycho</groupId>
                  <artifactId>tycho-maven-plugin</artifactId>
                  <version>${tycho-version}</version>
                  <extensions>true</extensions>
              </plugin>
       </plugins>
    </build>

     ....

</project>

Plugin POM

<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>
  <artifactId>my.plugin</artifactId>
  <packaging>eclipse-plugin</packaging>
  <parent>
    <groupId>my.group</groupId>
    <artifactId>plugin.releng</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../plugin.releng</relativePath>
  </parent>
</project>

Console Output

[INFO] --- tycho-packaging-plugin:0.19.0:build-qualifier (default-build-qualifier) @ my.plugin ---
[INFO] The project's OSGi version is 1.0.0.201403281132
[INFO] 
[INFO] --- tycho-packaging-plugin:0.19.0:validate-id (default-validate-id) @ my.plugin ---
[INFO] 
[INFO] --- tycho-packaging-plugin:0.19.0:validate-version (default-validate-version) @ my.plugin ---
[INFO] 
Was it helpful?

Solution

The jar file name is controlled by finalName. If you take a look inside the Manifest file in this jar, it will show the correct qualified version.

If you create a p2 repository with your plugins, they will contain the correct filenames.

From a maven point of view, the coordinates must match the POM and therefore the version is still -SNAPSHOT.

OTHER TIPS

I believe @blackbuild is correct.

Run maven package to create a version of the jar. A SNAPSHOT version will look like this:

  • org.XXX-1.0.0-SNAPSHOT.jar

But, when you deploy the SNAPSHOT to a repository, maven will set the version number. It will look like this in the repository:

  • org.XXX-1.0.0-20121231.173602-4.jar

Notice that the maven deploy translates the word SNAPSHOT to a version. See http://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom-syntax.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top