문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top