Maven 与 Ubuntu 15.10,收到错误:mvn 全新安装;



我正在使用昨天购买的由TransIP托管的vps。每个插件都像它应该的那样工作,除了 maven。我多次重新安装它,它似乎一直出错。

安装 ubuntu 15.10 后我所做的是:

  1. sudo apt-get install openjdk-8-jdk
  2. sudo apt-get install maven

然后我从 github 克隆了我的存储库到名为 my name 的用户文件夹中:

路径:/首页/集市/[存储库的文件夹]

完成后,我转到文件夹并使用:mvn clean install 。它给了我这个错误:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Discordbot 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.782 s
[INFO] Finished at: 2016-03-13T14:51:14+01:00
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

我的第二个想法是,也许我可以在不需要运行mvn clean install的情况下运行该项目,我运行了mvn exec:java。然后导致错误,因为它找不到答案。

这是我的绒球.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>martacus.mart.bot</groupId>
  <artifactId>Discordbot</artifactId>
  <version>0.0.1-SNAPSHOT</version>
    <repositories>
        <repository>
            <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
      <repository>
        <id>bintray-thejavanerd-maven</id>
        <name>bintray</name>
        <url>https://jcenter.bintray.com</url>
      </repository>
    </repositories>
    <dependencies>
       <dependency>
         <groupId>com.github.austinv11</groupId>
         <artifactId>Discord4j</artifactId>
         <version>2.3.1</version>
      </dependency>
      <dependency>
        <groupId>net.dean.jraw</groupId>
        <artifactId>JRAW</artifactId>
        <version>0.8.0</version>
      </dependency>
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.38</version>
      </dependency>
      <dependency>
        <groupId>com.mashape.unirest</groupId>
        <artifactId>unirest-java</artifactId>
        <version>1.4.8</version>
      </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <mainClass>martacus.mart.bot.Main</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

当我运行"mvn 版本"时,我得到:

Apache Maven 3.3.3
Maven home: /usr/share/maven
Java version: 1.8.0_66-internal, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.2.0-30-generic", arch: "amd64", family: "unix"

当我运行"java版本"时,我得到:

openjdk version "1.8.0_66-internal"
OpenJDK Runtime Environment (build 1.8.0_66-internal-b17)
OpenJDK 64-Bit Server VM (build 25.66-b17, mixed mode)

当我在谷歌周围搜索时,人们告诉我这与我的代理设置有关。但是我使用的是vps,公司无法给我代理设置。也许如果有办法找出它们是什么,它可能会解决问题,但我还没有找到获得它们的方法。

如果您想在 github 上查看我的存储库以获取有关该项目的更多信息:https://github.com/Martacus/DiscordBot

一切都在我的普通计算机上工作,但当然所有设置都不同,我使用 Windows 8。我希望人们能帮助我,如果您需要更多信息,请务必告诉我!

这可能与ca证书的问题有关,请尝试运行以下命令:

update-ca-certificates -f

根据手册页:

update-ca-certificates is a program that updates the directory /etc/ssl/certs to 
hold SSL certificates and generatescertificates.crt, a concatenated single-file 
list of certificates.

最新更新