使用maven插件运行wget时如何绕过SSL?

时间:2017-06-19 13:37:38

标签: maven ssl

我想在mvn开始打包之前执行以下wget。但是我得到了SSL握手错误,因为url是HTTPS。有没有办法绕过这个?我试图添加--no-check-cert但它失败了。

我的目标是下载属性文件并在打包时将它们捆绑到tar中。

       <plugin>
            <groupId>com.googlecode.maven-download-plugin</groupId>
            <artifactId>download-maven-plugin</artifactId>
            <version>1.3.0</version>
            <executions>
                <execution>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>wget</goal>
                    </goals>
                    <configuration>
                        <url>https://URL</url>
                        <outputFileName>file.name</outputFileName>
                        <outputDirectory>${project.build.directory}</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

该文件存在于我的机器具有完全访问权限的内部网络上。我在该网址上运行wget --no-cert没有问题。

[INFO] --- download-maven-plugin:1.3.0:wget (default) @ project ---
Downloading: https://URL.com/app.properties
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
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1917)

[ERROR] Failed to execute goal com.googlecode.maven-download-plugin:download-maven-plugin:1.3.0:wget (default) on project project: IO Error: Could not get content -> [Help 1]

0 个答案:

没有答案