Maven依赖性错误(工件)

时间:2016-03-14 16:38:55

标签: eclipse maven

我正在尝试使用maven安装Fenix框架,添加以下依赖项:

<dependency>
    <groupId>pt.ist</groupId>
    <artifactId>fenix-framework-backend-infinispan</artifactId>
    <version>2.0-cloudtm</version>
</dependency>

给出以下错误:缺少工件...

我的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>com.isban.test</groupId>
  <artifactId>fenixtest</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>fenixtest</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency> 
       <dependency>
        <groupId>pt.ist</groupId>
        <artifactId>fenix-framework-backend-infinispan</artifactId>
        <version>2.0-cloudtm</version>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<pluginRepositories>
  <pluginRepository>
    <id>fenix-ashes-maven-repository</id>
    <url>https://fenix-ashes.ist.utl.pt/maven-public</url>
  </pluginRepository>
</pluginRepositories>

<repositories>
  <repository>
    <id>fenix-ashes-maven-repository</id>
    <url>https://fenix-ashes.ist.utl.pt/maven-public</url>
  </repository>
</repositories>

</project>

官方文件:https://fenix-framework.github.io/Usage.html

有谁知道我做错了什么?

1 个答案:

答案 0 :(得分:3)

这些工件在Maven Central上不可用,但在特定的Fénix存储库中不可用。来自official page

  

这些工件可以通过FénixFrameworkNexus存储库获得,因此您需要将其添加到您的配置中:

<pluginRepositories>
  <pluginRepository>
    <id>fenix-ashes-maven-repository</id>
    <url>https://fenix-ashes.ist.utl.pt/maven-public</url>
  </pluginRepository>
</pluginRepositories>

<repositories>
  <repository>
    <id>fenix-ashes-maven-repository</id>
    <url>https://fenix-ashes.ist.utl.pt/maven-public</url>
  </repository>
</repositories>

该页面实际上有一个拼写错误,我在此更正了:最后一个元素应该是<repositories>而不是<pluginRepositories>。因此,您需要将这些存储库添加到POM(或Maven设置)。

依赖

<dependency>
  <groupId>pt.ist</groupId>
  <artifactId>fenix-framework-backend-infinispan</artifactId>
  <version>2.0-cloudtm</version>
</dependency>

在文档中也是错误的:该工件确实doesn't exist。最新版本是2.6.2,工件应该是fenix-framework-backend-infinispan-code-generator,所以你应该改为:

<dependency>
  <groupId>pt.ist</groupId>
  <artifactId>fenix-framework-backend-infinispan-code-generator</artifactId>
  <version>2.6.2</version>
</dependency>