0

Imagine I have this entry in my target file (used as active target in my tycho build):

<location includeAllPlatforms="true" includeMode="slicer" includeSource="true" type="InstallableUnit">
  <repository id="orbit_I" location="http://download.eclipse.org/tools/orbit/downloads/drops/I20131203074849/repository/"/>
  <unit id="javax.servlet" version="3.0.0.v201112011016"/>
</location>

Can I reference this plugin as maven artifact (to use the maven-dependency-plugin)? What is the groupId/artifactId of the bundle?

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>???</groupId>
                  <artifactId>javax.servlet</artifactId>
                  <version>3.0.0.v201112011016</version>
                  <type>???</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
                  <destFileName>optional-new-name.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>

In this example I tried a lot of combination, to replace the ??? with something that make sense.

I get always the same error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (copy) on project ** Unable to find artifact version of ???:??? in either dependency list or in project's dependency management. -> [Help 1]

Thanks a lot for your answers.

Jmini
  • 9,189
  • 2
  • 55
  • 77

1 Answers1

1

Tycho injects the bundle dependencies from p2 repositories are into the Maven model with a synthetic groupId p2.eclipse-plugin. Using this groupId and the bundle symbolic name as artifactId, you should be able to reference the p2 dependencies from any Maven plugin.

BTW, you can see the injected dependencies by adding the tree goal of the maven-dependency-plugin, e.g. with mvn clean verify dependency:tree.

oberlies
  • 11,503
  • 4
  • 63
  • 110
  • I had to use "mvn verify dependency:tree" because with your command I got "[ERROR] No plugin found for prefix 'maven-dependency-plugin' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [..] -> [Help 1]". Maybe my maven configuration is not Ok. – Jmini Dec 25 '13 at 22:09
  • @Jmini I thought both the long and the short version did the same. But if only the short version works, I'll put that in the answer. – oberlies Dec 28 '13 at 17:04