我正在尝试在Jenkins/Hudson上配置我的电子邮件,并且我经常收到错误:
java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be
non-empty
Run Code Online (Sandbox Code Playgroud)
我在网上看到了大量有关错误的信息,但我没有任何工作.我在Fedora Linux上使用Sun的JDK(而不是OpenJDK).
以下是我尝试过的一些事情.我尝试按照这篇文章的建议,但将cacerts从Windows复制到我托管Jenkins的Fedora盒子都没有用.我尝试将Gmail配置为我的SMTP服务器时尝试按照本指南操作,但它也无法正常工作.我还尝试手动下载并移动这些cacert文件,并使用本指南中的命令变体将它们移动到我的Java文件夹.
我对任何建议持开放态度,因为我现在正被困住.我已经从Windows Hudson服务器上工作了,但我在Linux上苦苦挣扎.
有没有办法我可以配置maven 总是下载源和javadocs?-DdownloadSources=true -DdownloadJavadocs=true每次指定(通常伴随着运行mvn编译两次因为我第一次忘记)变得相当乏味.
我确实想将自签名证书导入Java,因此任何尝试建立SSL连接的Java应用程序都会信任此证书.
到目前为止,我设法将其导入
keytool -import -trustcacerts -noprompt -storepass changeit -alias $REMHOST -file $REMHOST.pem
keytool -import -trustcacerts -noprompt -keystore cacerts -storepass changeit -alias $REMHOST -file $REMHOST.pem
Run Code Online (Sandbox Code Playgroud)
不过,当我尝试跑步时,HTTPSClient.class我仍然得到:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
我经常需要运行"mvn"命令:
mvn -f pom.xml clean install -Dmaven.test.skip=false --settings /Users/myhome/settings.xml -X -Djavax.net.ssl.trustStore=/Users/myhome/truststore.jks -Djavax.net.ssl.trustStoreType=JKS -Djavax.net.ssl.trustStorePassword=dummy -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -U
Run Code Online (Sandbox Code Playgroud)
由于我需要与其他各种域集成,因此每次我必须将其证书添加到truststore.jks以防止SSL握手错误.
有什么办法可以配置mvn来忽略SSL错误.
我正在使用基于Eclipse 3.7的springsource工具套件2.7.2.Maven插件现在开箱即用Eclipse,这很棒,即使使用以前的Eclipse版本也会出现这个问题.
所以这是我的问题:
我已经在我的settings.xml文件中设置了代理信息,并且在命令行上Maven工作得很好.我也在Eclipse配置本身设置了相同的代理详细信息,我知道它是正确的,并且更新与它一起工作,而不是没有.
当然,Eclipse安装中的Maven插件设置为使用正确的settings.xml文件.
但是eclipse中的maven只是没有使用其中任何一个地方的代理设置,每次更改pom文件时这都非常烦人.有没有人有这个问题的解决方案?
这是我的settings.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<settings 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/settings-1.0.0.xsd">
<profiles>
<profile>
<id>general</id>
<repositories>
<repository>
<snapshots><enabled>false</enabled></snapshots>
<id>ibiblio</id>
<name>Maven ibiblio</name>
<url>http://www.ibiblio.org/maven2</url>
</repository>
<repository>
<snapshots><enabled>true</enabled></snapshots>
<id>ibiblio2</id>
<name>Maven ibiblio2</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
</repository>
<repository>
<snapshots><enabled>true</enabled></snapshots>
<id>maven</id>
<name>Maven sunsite</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<snapshots><enabled>true</enabled></snapshots>
<id>jboss</id>
<name>Maven jboss</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>general</activeProfile>
</activeProfiles>
<proxies>
<proxy>
<id>proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>myproxyserver</host>
<port>80</port>
<username>myusername</username>
<password>mypassword</password>
</proxy>
</proxies>
</settings>
Run Code Online (Sandbox Code Playgroud) 我在conf/settings.xml中设置了maven代理设置
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.my-company.com</host>
<port>8080</port>
</proxy>
Run Code Online (Sandbox Code Playgroud)
但是当我运行maven build时,我遇到了以下错误.有人可以请帮助
[WARNING] The POM for org.apache.maven.wagon:wagon-ssh:jar:2.2 is missing, no dependency information available
详细的日志
mvn -X Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500) Maven home: C:\tools\apache-maven-3.0.4 Java version: 1.6.0_12, vendor: Sun Microsystems Inc. Java home: C:\tools\Java\jdk1.6.0_12\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows xp", version: "5.1", arch: "x86", family: "windows" [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from C:\tools\apache-maven-3.0.4\conf\settings.xml [DEBUG] Reading user settings from C:\Documents and Settings\desibaba\.m2\settings.xml [DEBUG] Using …
我正在尝试使用现有项目创建一个原型,mvn archetype:create-from-project但我得到了
Could not transfer artifact org.apache.maven.archetype:archetype-packaging:pom:3.0.0
from/to central (https://repo.maven.apache.org/maven2):
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
Run Code Online (Sandbox Code Playgroud)
我在防火墙后面所以我按照这篇文章/sf/answers/1813908771/ 然后执行:
$ mvn archetype:create-from-project -Djavax.net.ssl.keyStore=trustCARoot.jks
-Djavax.net.ssl.keyStorePassword=password
-Djavax.net.ssl.keyStoreType=JKS
-Djavax.net.ssl.trustStore=trustCARoot.jks
-Djavax.net.ssl.trustStorePassword=password
-Djavax.net.ssl.trustStoreType=JKS
Run Code Online (Sandbox Code Playgroud)
我仍然得到相同的PKIX路径构建失败,但只是为了 archetype-packaging
[INFO] Setting default groupId: com.domain.rozycki
[INFO] Setting default artifactId: SkillsApp
[INFO] Setting default version: 0.0.1-SNAPSHOT
[INFO] Setting default package: com.domain.skillsapp
[INFO] Scanning for projects...
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-packaging/3.0.0/archetype-packaging-3.0.0.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable …Run Code Online (Sandbox Code Playgroud) 我已阅读了类似问题的一些问题以及“帮助1”页面。不幸的是,我被困住了。
一个可能的原因可能是代理引起的,但是这里没有这样的代理。另外,当我从Eclipse更新它时,我PC中的所有maven项目都已成功更新。所以我放弃了这种可能性。
我检查的另一件事是在本地存储库中查找codehaus,然后找到它(C:\ Users \ myUser.m2 \ repository \ org \ codehaus \ mojo)。
另一种尝试,我尝试在设置中添加pluginGroups / pluginGroup。该项目是一个非常简单的问候词,仅使用Spring Batch和Tasklet及其execute方法。没有公共的static void main方法。
我添加了Matteo建议后,打印了整个错误的Command.exe:
C:\temp\TaskletJavaConfig\spring-batch-helloworld>mvn compile exec:java -e
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~2\HP\QUICKT~1\
bin\JAVA_S~1\classes;C:\PROGRA~2\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine.jar
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-p
lugin/1.1/exec-maven-plugin-1.1.pom
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:exec-maven-
plugin:1.1: Plugin org.codehaus.mojo:exec-maven-plugin:1.1 or one of its depende
ncies could not be resolved: Failed to read artifact descriptor for org.codehaus
.mojo:exec-maven-plugin:jar:1.1
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom …Run Code Online (Sandbox Code Playgroud) 我是Maven新手,无法添加依赖项(sl4j)。我得到了这个项目,该项目显然已从蚂蚁转换为行家。顺便说一句,全新安装无法正常工作。这是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.xxx.tools</groupId>
<artifactId>someName</artifactId>
<version>1.0</version>
<name>A Name</name>
<description>Description</description>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.MyClient</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
全新安装后将显示以下消息:
`ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project xxxx: Execution default of goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade failed: Plugin org.apache.maven.plugins:maven-shade-plugin:3.1.0 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-shade-plugin:jar:3.1.0 -> org.apache.maven:maven-plugin-api:jar:3.0 -> …Run Code Online (Sandbox Code Playgroud) maven ×7
java ×6
certificate ×2
eclipse ×2
maven-3 ×2
proxy ×2
ssl ×2
dependencies ×1
hudson ×1
jakarta-mail ×1
jenkins ×1
keystore ×1
keytool ×1
plugins ×1
spring ×1