Maven部署到Nexus,没有X509TrustManager

时间:2015-11-02 10:07:30

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

我正在尝试使用maven将deb-package部署到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>

谢谢,BadJoke

1 个答案:

答案 0 :(得分:1)

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

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