gpt4 book ai didi

maven-3 - 无法解决Tycho项目中的Mockito依赖关系

转载 作者:行者123 更新时间:2023-12-04 18:14:36 27 4
gpt4 key购买 nike

Possible Duplicate:
How to reference mockito within tycho?

I am trying to get a test feature project building with Tycho, but it fails to resolve dependencies listed in my pom from the Maven central repository that is listed in my parent pom. Here is the relevant part from my parent pom:

    <properties>
<tycho-version>0.12.0</tycho-version>
</properties>

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

<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Maven Plugin Repository</name>
<url>http://repo1.maven.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>

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

<configuration>
<pomDependencies>consider</pomDependencies>

<resolver>p2</resolver>

<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>

and here my feature pom:

    <modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>parent</artifactId>
<groupId>com.example</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.example</groupId>
<artifactId>com.example.testing.feature</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.5</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
</dependencies>

when I run mvn clean package on my feature project, I get the following:

[INFO] Adding repository http://download.eclipse.org/releases/helios/
[INFO]添加存储库http://download.eclipse.org/releases/helios/
[DEBUG]添加了p2存储库helios(http://download.eclipse.org/releases/helios/
)
[DEBUG]忽略Maven中央存储库(http://repo1.maven.org/maven2)

然后我的构建失败,因为无法解决我的依赖性。我想念什么吗?这是因为为目标平台配置配置了p2解析器吗?

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com