【问题标题】:Could not resolve dependencies for project无法解析项目的依赖关系
【发布时间】:2014-02-02 17:01:03
【问题描述】:

我是 maven 新手,我正在尝试使用 pom.xml 将项目编译到 jar 中。我对插件做了一些小改动,我想编译它以供使用。但是,当尝试在包含“pom.xml”的目录中使用“mvn install”编译它时,我收到错误:http://puu.sh/6Hs2f/92c3a81adb.png

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.minecraftdimensions.bungeesuitespawn</groupId>
    <artifactId>BungeeSuiteSpawn</artifactId>
    <version>0.5</version>
    <packaging>jar</packaging>
    <name>BungeeSuiteSpawn</name>

    <properties>
        <build.number>${BUILD_NUMBER}</build.number>
    </properties>

    <repositories>
        <repository>
            <id>bukkit-repo</id>
            <url>http://repo.bukkit.org/content/groups/public</url>
        </repository>
        <repository>
            <id>vault-repo</id>
            <url>http://ci.herocraftonline.com/plugin/repository/everything</url>
        </repository>
        <repository>
            <id>md-5</id>
            <url>
                http://ci.md-5.net/job/BungeeSuiteTeleports/com.minecraftdimensions.bungeesuiteteleports$BungeeSuiteTeleports/lastBuild/artifact/
            </url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.6.2-R0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.minecraftdimensions.bungeesuiteteleports</groupId>
            <artifactId>BungeeSuiteTeleports</artifactId>
            <version>0.50</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>${project.name}</finalName>
        <resources>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <includes>
                    <include>**</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

GitHub 项目:https://github.com/Nentify/BungeeSuiteSpawn

【问题讨论】:

  • 为什么不直接用stackoverflow图片上传上传图片?

标签: java maven jar intellij-idea compilation


【解决方案1】:

minecraftdimensions.bungeesuitespawnartifact not exist on repositoryhttp://repo.bukkit.org/content/groups/public/`。

您可以从存储库下载 jar,并使用系统范围创建构建。 ${basedir} 是你的 pom 的目录。

 <dependency>
        <artifactId>..</artifactId>
        <groupId>..</groupId>
        <scope>system</scope>
        <version>0.5</version> 
        <systemPath>${basedir}/BungeeSuiteTeleports.jar</systemPath>
    </dependency>

【讨论】:

  • 但不应该存在于 repo #3 中?
  • repo #3 是什么意思
  • 你如何在setting.xml中声明这3个repo?
  • setting.xml 在哪里?我只有 pom.xml 和 3 个 repos。
猜你喜欢
  • 2020-09-09
  • 2022-01-23
  • 2015-06-04
  • 2019-06-11
  • 1970-01-01
  • 2018-06-26
  • 2015-09-01
  • 2021-04-03
  • 2015-01-14
相关资源
最近更新 更多