【问题标题】:Maven deploy to Nexus, No X509TrustManagerMaven 部署到 Nexus,没有 X509TrustManager
【发布时间】:2015-11-02 10:07:29
【问题描述】:

我正在尝试使用 maven 将 deb 包部署到 Nexus。但我得到了错误

No X509TrustManager implementation available

没有可用的堆栈跟踪,只有一个异常:java.security.cert.CertificationException。

那么,如何让 X509TrustManager 进入 maven? 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>******</groupId>
    <artifactId>************</artifactId>

    <name>**********</name>
    <description>*****************</description>

    <properties>
        <aspectj.version>1.6.12</aspectj.version>
        <maven.compiler.version>1.6</maven.compiler.version>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
        <maven.wagon.http.ssl.insecure>true</maven.wagon.http.ssl.insecure>
        <maven.wagon.http.ssl.allowall>true</maven.wagon.http.ssl.allowall>
        <maven.wagon.http.ssl.ignore.validity.dates>true</maven.wagon.http.ssl.ignore.validity.dates>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>aop.xml</include>
                </includes>
                <targetPath>META-INF</targetPath>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>aop.xml</exclude>
                </excludes>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>aspectj-maven-plugin</artifactId>
                    <version>1.5</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjtools</artifactId>
                            <version>${aspectj.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjrt</artifactId>
                            <version>1.5.4</version>
                        </dependency>
                        <dependency>
                            <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-api</artifactId>
                            <version>1.6.2</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <complianceLevel>${maven.compiler.target}</complianceLevel>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <outxml>true</outxml>
                        <verbose>true</verbose>
                        <showWeaveInfo>true</showWeaveInfo>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>      <!-- use this goal to weave all your main classes -->
                                <goal>test-compile</goal> <!-- use this goal to weave all your test classes -->
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>${maven.compiler.version}</source>
                        <target>${maven.compiler.version}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            aspectj-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.3,)
                                        </versionRange>
                                        <goals>
                                            <goal>compile</goal>
                                            <goal>test-compile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <artifactId>jdeb</artifactId>
                <groupId>org.vafer</groupId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jdeb</goal>
                        </goals>
                        <configuration>
                            <classifier>all</classifier>
                            <dataSet>
                                <data>
                                    <src>${project.build.directory}/${project.build.finalName}.jar</src>
                                    <type>file</type>
                                    <mapper>
                                        <type>perm</type>
                                        <prefix>/opt/tomcat/webapps/jsf/WEB-INF/lib</prefix>
                                    </mapper>
                                </data>
                            </dataSet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
            </plugin>
        </plugins>

    </build>

    <distributionManagement>
        <repository>
            <id>deployment</id>
            <name>**************</name>
            <url>***********************************</url>
        </repository>
    </distributionManagement>

    <version>1.0</version>
    <packaging>jar</packaging>
    <dependencies>
        <dependency>
            <groupId>**********</groupId>
            <artifactId>**********</artifactId>
            <version>1.2.6</version>
            <scope>system</scope>
            <systemPath>*****************</systemPath>
        </dependency>
        <dependency>
            <groupId>aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.5.4</version>
        </dependency>
        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.1</version>
        </dependency>
    </dependencies>
</project>

谢谢,恶作剧

【问题讨论】:

  • 您需要添加更多信息:pom.xml 并首先完成堆栈跟踪。
  • 没有stacktrace,只是一个异常:java.security.cert.CertificateException
  • 我们 StackOverflow 没有水晶球来弄清楚产生上述错误的代码是什么。请发帖MCVE
  • @Tunaki 编辑了问题以包括pom.xml。 @Sumurai8 我无法提供任何代码,因为我使用的是 m2e 插件。

标签: eclipse maven nexus x509 maven-deploy-plugin


【解决方案1】:

这似乎是您的 JDK 的问题。例如。查看this bug.

我建议升级到您选择的 JDK 的最新版本,如果仍然失败,请尝试使用 Oracle 的最新 Java8 版本。

【讨论】:

  • 谢谢,我明天测试一下
猜你喜欢
  • 1970-01-01
  • 2013-03-06
  • 2018-11-29
  • 1970-01-01
  • 2011-06-20
  • 2013-08-11
  • 1970-01-01
  • 2017-04-27
  • 1970-01-01
相关资源
最近更新 更多