我从一个POM.xml文件开始,只有两个依赖项工作正常:
<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>QRE</groupId>
<artifactId>QRE</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.ecore</artifactId>
<version>2.11.1-v20150805-0538</version>
</dependency>
<dependency>
<groupId>org.eclipse.emf</groupId>
<artifactId>org.eclipse.emf.common</artifactId>
<version>2.11.0-v20150805-0538</version>
</dependency>
</dependencies>
</project>
现在我需要在org.eclipse.uml.types上添加一个依赖项,所以我从Maven Central添加了这个:
<!-- https://mvnrepository.com/artifact/org.eclipse.uml2/types -->
<dependency>
<groupId>org.eclipse.uml2</groupId>
<artifactId>types</artifactId>
<version>2.0.0-v20140602-0749</version>
</dependency>
我用&#34;清洁&#34;运行Maven。和#34;安装&#34;目标,得到:
Failed to execute goal on project QRE: Could not resolve dependencies for project QRE:QRE:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.eclipse.uml2:types:jar:2.0.0-v20140602-0749 -> org.eclipse.emf:ecore:jar:[2.10.0,3.0.0): No versions available for org.eclipse.emf:ecore:jar:[2.10.0,3.0.0) within specified range -> [Help 1]
...这很奇怪,因为我已经依赖org.eclipse.emf.ecore 2.11.1-v20150805-0538,它应该满足该依赖性。我也尝试从&#34; jar&#34;更改org.eclipse.uml2.types依赖项。 to&#34; java-source&#34;但那没有用。
我尝试过 - &gt; Maven-&gt;使用&#34;强制更新快照/版本&#34;更新项目。结果是在“问题”选项卡中出现了大量错误,主要是&#34;缺少工件&#34;而且&#34;没有可用于org.eclipse.emf的版本:ecore:jar:[2.10.0,3.0.0]在指定的范围内&#34;和#34;容器&#39; Maven Dependencies&#39;引用非现有库&C; \ Users \ mhl.m2 \ repository \ org \ eclipse \ core \ runtime \ 3.10.0-v20140318-2214 \ runtime-3.10.0-v20140318-2214.jar&#39; QRE&#34;
我尝试在c:\ Users \ mhl.m2 \ repository中删除我的存储库的全部内容,但这也没有帮助。
我需要做些什么来使这种依赖工作?