Eclipse cannot find dependencies of a plugin built with Maven Tycho

女生的网名这么多〃 提交于 2020-01-13 06:00:31

问题


I am using Maven Tycho to compile my projects which are structured like this :

- plugin1
 - plugin2 (depends on plugin1)
 - plugin3 (depends on plugin1 & 2)
 - plugin4 (depends on plugin1)
 - plugin5 (depends on plugin1 & 4)
 - plugin6 (depends on all previous plugins)
 - plugin7 (depends on all previous plugins)
{all these plugins are compiled as eclipse-plugin}
 - feature1 (contains all previous plugins) {eclipse-feature}
 - updatesite1 {eclipse-repository}
 - generalproject (contains only the parent pom)

I compile this via Eclipse (maven install), everything works and i can access my local repository, and install my feature in the same Eclipse (through "Install new software").

The problem is when i try to install my feature to another instance of Eclipse, which refuse to install it with the error :

(Missing requirement: Acceleo Texts Module IDE Plug-in 1.0.0.201612161812 (myproject.acceleo.ui 1.0.0.201612161812) requires 'bundle org.eclipse.ocl 0.0.0' but it could not be found)

I know that this is a non satisfied requirement problem, but in Eclipse i checked "Contact all update sites during install to find required software", and my pom declares repositories containing all requirements, here is my parent 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>myproject.project</groupId>
  <artifactId>myproject.general</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>

   <properties>
  <tycho.version>0.23.0</tycho.version>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 </properties>

  <repositories>
  <repository>
   <id>Mars</id>
   <layout>p2</layout>
   <url>http://download.eclipse.org/releases/mars/</url>
  </repository>

   <repository>
  <id>Sirius</id>
   <layout>p2</layout>
   <url>http://download.eclipse.org/sirius/updates/releases/4.1.2/mars/</url>
  </repository>
 </repositories>

 <build>
  <plugins>

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

   <plugin>
    <!-- enable tycho build extension -->
    <groupId>org.eclipse.tycho</groupId>
     <artifactId>target-platform-configuration</artifactId>
    <version>${tycho.version}</version>
    <configuration>
    <environments>
    <environment>
      <os>linux</os>
      <ws>gtk</ws>
      <arch>i386</arch>
    </environment>
     <environment>
          <os>linux</os>
          <ws>gtk</ws>
          <arch>x86_64</arch>
        </environment>
       <environment>
          <os>win32</os>
          <ws>win32</ws>
          <arch>x86</arch>
        </environment>
        <environment>
          <os>win32</os>
          <ws>win32</ws>
          <arch>x86_64</arch>
        </environment>
        <environment>
          <os>macosx</os>
          <ws>cocoa</ws>
          <arch>x86_64</arch>
        </environment>
     </environments>
   </configuration>
   </plugin>

  </plugins>
 </build>

 <modules>
  <module>../myproject</module>
  <module>../myproject.acceleo</module>
  <module>../myproject.acceleo.ui</module>
  <module>../myproject.design</module>
  <module>../myproject.edit</module>
  <module>../myproject.editor</module>
  <module>../myproject.plugin</module>
  <module>../myproject.project</module>
  <module>../myproject.site</module>
 </modules>
</project>

I cannot figure how to resolve this ? did i omit something in my procedure ? Thank you.


回答1:


Probably the Eclipse installation where you want to install your feature does not have an update site configured that contains org.eclipse.ocl. This has nothing to do with your Maven build, as long as you didn't configure your feature to also contain the required bundles, which could also be done.




回答2:


I fell for the same thing. Tycho does not include all dependencies, even though that's normal and desired maven behaviour. As maven does not "see" tycho (so manifest-derived) dependencies, they are not included.

You can override this behaviour by setting to true:

<plugin>
 <groupId>org.eclipse.tycho</groupId>
 <artifactId>tycho-p2-repository-plugin</artifactId>
 <version>${tycho-version}</version>
 <configuration>
    <includeAllDependencies>true</includeAllDependencies>
 </configuration>
</plugin>  


来源:https://stackoverflow.com/questions/41223862/eclipse-cannot-find-dependencies-of-a-plugin-built-with-maven-tycho

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!