Problem with loading SSL in Maven

I am trying to create a Confluence plugin. I follow the abstract instructions .

However, when I run the atlas-create-confluence-plugin command, maven throws SSL errors trying to get the resource from https://m2proxy.atlassian.com/repository/public/ .

alt text http://img46.imageshack.us/img46/6281/mavenssl.jpg

Do I need to change the setting in my configuration?

System Setup: Windows Vista with Apache Maven 2.1.0 (r755702; 2009-03-18 19: 10: 27 + 0000)

+4
source share
3 answers

Accessing the repository via SSL is not a Maven problem (which uses HttpClient under the hood and in the end classes from the java.net package), it is a pure Java problem: the certificate of the remote repository should be, for example, the root CA certificate for this certificate should be in the cacerts that is part of the JRE, or you need to set up the trust chain manually.

In the particular case, https://m2proxy.atlassian.com/ certificate is issued by DigiCert CA.

The odd part is that recent JDKs (Java 5u15 or later or Java 6u5 or later, see Bug ID: 6647251 ) have a CA root certificate for DigiCert. So, with the recent JDK, everything should work (unless you have a proxy server that does black magic, as in this question ).

If you are using an old JDK and cannot upgrade it, export the certificate from your browser, use keytool to add it to the trust store and configure Java to use this trust store (using javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword system properties). See the Maven mini guide and / or this blog post for more details on how to do this.

But the easiest way would be to use the recent JDK.

+5
source

OK, it looks like my question is wrong.

For some reason, maven did not download the maven-confluence-plugin-3.0.5.jar file. I had to manually download this file from the URL and add it to the desired .m2 folder.

After that, the whole process worked fine.

0
source

In most cases, Pascal answer is the way to go. However, if you build Maven yourself, this does not work (at least from Maven 3.2.3), since ant does not pass the necessary properties to javax.net when it calls the MavenCli class to allow Maven to build the rest of Maven.

The solution to this problem is to modify the build.xml file in the root directory of the maven source directory and add these lines to the maven-compile target:

 <arg value="-Djavax.net.ssl.trustStore=/path/to/trustStore" /> <arg value="-Djavax.net.ssl.trustStorePassword=TrustStorePassword" /> 
0
source

Source: https://habr.com/ru/post/1301182/


All Articles