Maven与Ubuntu 15.10,出现错误:mvn clean install; [英] Maven with Ubuntu 15.10, getting errors with: mvn clean install;
问题描述
我正在使用我昨天购买的TransIP托管的vps。除Maven之外,每个插件的工作方式都应该如此。我重新安装了它多次,它似乎一直给出错误。
一旦我安装了Ubuntu 15.10,我做了什么:
- sudo apt-get install openjdk-8-jdk
- sudo apt-get install maven
- sudo apt-get install openjdk-8-jdk
- sudo apt-get install maven
然后我从github中将我的存储库克隆到名为my name的用户文件夹中:
路径:/ home / mart / [回购的文件夹]
完成后,我转到该文件夹并使用: mvn clean install
。它给了我这个错误:
[信息]扫描项目...
[信息]
[INFO] ----------------------------------------------- -------------------------
[INFO]构建Discordbot 0.0.1-SNAPSHOT
[信息] ---- -------------------------------------------------- ------------------
正在下载: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] ------------------------------------------ ------------------------------
[信息]总时间:0.782 s
[信息]完成at:2016-03-13T14:51:14 + 01:00
[INFO] Final Memory:6M / 15M
[INFO] --------------- -------------------------------------------------- -------
[错误]插件org.apache.maven.plugins:maven-clean-plugin:2.5或其某个依赖关系无法解析:无法读取org.a的工件描述符pache.maven.plugins:maven-clean-plugin:jar:2.5:无法传输工件org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from / to central(https://repo.maven。 apache.org/maven2):java.lang.RuntimeException:意外错误:java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空 - > [帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整的调试日志记录。
[错误]
[错误]有关错误和可能解决方案的更多信息,请阅读以下文章:
[错误] [帮助1] http://cwiki.apache.org / confluence / display / MAVEN / PluginResolutionException
我的第二个想法是我可以运行该项目而不需要运行 mvn clean install
,然后运行 mvn exec:java
。然后导致错误,因为它找不到依赖关系。
这是我的pom.xml:
< project xmlns =http://maven.apache.org/POM/4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexsi: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>
<名称> bintray< /名称>
< url> https://jcenter.bintray.com< / url>
< / repository>
< / repositories>
<依赖关系>
< dependency>
< groupId> com.github.austinv11< / groupId>
< artifactId> Discord4j< / artifactId>
< version> 2.3.1< / version>
< /依赖关系>
< dependency>
< groupId> net.dean.jraw< / groupId>
< artifactId> JRAW< / artifactId>
< version> 0.8.0< / version>
< /依赖关系>
< dependency>
< groupId> mysql< / groupId>
< artifactId> mysql-connector-java< / artifactId>
< version> 5.1.38< / version>
< /依赖关系>
< dependency>
< groupId> com.mashape.unirest< / groupId>
< artifactId> unirest-java< / artifactId>
< version> 1.4.8< / version>
< /依赖关系>
< /依赖关系>
< build>
< plugins>
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> exec-maven-plugin< / artifactId>
< version> 1.2.1< / version>
<配置>
< mainClass> martacus.mart.bot.Main< / mainClass>
< / configuration>
< / plugin>
< / plugins>
< / build>
< / project>
运行'mvn -version'时,我得到:
Apache Maven 3.3.3
Maven home:/ usr / share / maven
Java版本:1.8.0_66-internal,供应商:Oracle Corporation
Java home:/ usr / lib / jvm / java-8-openjdk-amd64 / jre
默认语言环境:en_US,平台编码:UTF-8
操作系统名称:linux 4.2.0-30-generic,arch:amd64,family:unix
当我运行'java -version'时:
openjdk version1.8.0_66-internal
OpenJDK Runtime环境(build 1.8.0_66-internal-b17)
OpenJDK 64位服务器虚拟机(构建25.66-b17,混合模式)
当我搜索谷歌的时候,人们告诉我说它和我的代理设置有关。但我使用的是VPS,公司不能给我代理设置..也许如果有办法找出它们可能会解决问题,但我还没有找到一种方法来获得这些。 p>
如果您想在github上看到我的回购,以获取有关该项目的更多信息: https://github.com/Martacus/DiscordBot
一切工作在我的普通计算机上,但是当然,所有设置都是不同的,我使用Windows 8.我希望人们可以帮助我,如果您需要更多信息,请务必让我知道!
>这可能与ca-certificates的问题有关,试着运行这个命令: update-ca-certificates -f
根据手册页:
<$ p $ update-ca-certificates是一个程序,它将目录/ etc / ssl / certs更新为
保存SSL c ertificates和generatecertificates.crt,一个串联的单文件
证书列表。
I am using a vps hosted by TransIP that i bought yesterday. Every plugin works like it should except maven. Ive reinstalled it multiple times and it just seems to give errors the whole time.
What I did once I installed ubuntu 15.10 is:
Then I cloned my repository from github into the user folder named my name:
Path:/home/mart/[folder of the repo]
Once I was done I went to the folder and used: mvn clean install
. It gave me this error:
[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
My second thought was maybe I could run the project without needing to run mvn clean install
and I ran mvn exec:java
. Which then resulted in an error because it can't find the depencies.
This is my 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>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>
When I run 'mvn -version' I get:
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"
When I run 'java -version' I get:
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)
When I searched around google people told me that it had something to do with my proxy settings. But I am using a vps and the company couldnt give me the proxy settings.. Maybe if there is a way to find out what they are it might solve the problem, but I haven't found a way to get those yet.
If you'd like to see my repo on github for more information about the project: https://github.com/Martacus/DiscordBot
Everything works on my normal computer, but ofcourse the settings for everything is different and I use windows 8. I do hope people can help me and if you would need more information make sure to let me know!
It's maybe related to a problem of ca-certificates, try to run this command:
update-ca-certificates -f
According to the man page:
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.
这篇关于Maven与Ubuntu 15.10,出现错误:mvn clean install;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!