Maven 1
----------
With maven 1, we got this working in the following fashion.
In the project.properties we have an entry for the repository as follows:
<pre>
[…]
maven.repo.remote=https://${user.name}:[EMAIL PROTECTED]/projects/maven/repository,\
http://www.ibiblio.org/maven
[…]
</pre>
and in ~/build.properties we an entry as follows:
<pre>
[…]
[EMAIL PROTECTED]
[…]
</pre>
The certificate is imported using the java keytool as follows:
<kbd>
sudo keytool -keystore $JAVA_HOME/lib/security/cacerts -import -file cvs_peopleware_be.cer
</kbd>
(On Mac OS X, and mutatis mutandi on other Unix variants and Windows).
With these settings, this has been working for us with maven 1 for a year.
Maven 2
----------
Now how do we get this working with maven 2? I didn't find a working solution in the documentation, wiki or mailing list archives.
What I have so far is
An entry in the pom.xml as follows:
<pre>
[…]
<repositories>
<repository>
<id>ppw-missing</id>
<name>PeopleWare Repository of Missing Artifacts</name>
<url>https://cvs.peopleware.be/projects/maven/maven2/repository</url>
</repository>
[…]
</repositories>
[…]
</pre>
An entry in ~/.m2/settings.xml as follows:
<pre>
[…]
<servers>
<server>
<id>ppw-missing</id>
<username>thisIsMe</username>
<password>[EMAIL PROTECTED]</password>
</server>
[…]
</servers>
[…]
</pre>
The certificate was installed before, as discussed higher, and nothing change there.
With these settings, I get the following error:
<samp>
[…]
[INFO] ----------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: javax.faces:jsf-api
Reason: Error getting POM for 'javax.faces:jsf-api' from the repository: Error transferring file
javax.faces:jsf-api:1.1_01:pom
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
ppw-missing (https://cvs.peopleware.be/projects/maven/maven2/repository),
ppw-libraries (https://cvs.peopleware.be/projects/JavaLibraries/maven2-repository)
[INFO] ----------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'javax.faces:jsf-api:jar': Error getting POM for 'javax.faces:jsf-api' from the repository: Error transferring file
javax.faces:jsf-api:1.1_01:pom
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
ppw-missing (https://cvs.peopleware.be/projects/maven/maven2/repository),
ppw-libraries (https://cvs.peopleware.be/projects/JavaLibraries/maven2-repository)
javax.faces:jsf-api:1.1_01:jar
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
ppw-missing (https://cvs.peopleware.be/projects/maven/maven2/repository),
ppw-libraries (https://cvs.peopleware.be/projects/JavaLibraries/maven2-repository)
Path to dependency:
1) be.peopleware:ppw-value-II:jar:1.3.0-1.2-MAVEN2TEST
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:536)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:482)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:452)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:301)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:268)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:113)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information: Unable to read the metadata file for artifact 'javax.faces:jsf-api:jar': Error getting POM for 'javax.faces:jsf-api' from the repository: Error transferring file
javax.faces:jsf-api:1.1_01:pom
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
ppw-missing (https://cvs.peopleware.be/projects/maven/maven2/repository),
ppw-libraries (https://cvs.peopleware.be/projects/JavaLibraries/maven2-repository)
javax.faces:jsf-api:1.1_01:jar
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
ppw-missing (https://cvs.peopleware.be/projects/maven/maven2/repository),
ppw-libraries (https://cvs.peopleware.be/projects/JavaLibraries/maven2-repository)
Path to dependency:
1) be.peopleware:ppw-value-II:jar:1.3.0-1.2-MAVEN2TEST
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:289)
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:67)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:223)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:211)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:182)
at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDependencies(DefaultPluginManager.java:1152)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:353)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:519)
... 16 more
Caused by: org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException: Unable to read the metadata file for artifact 'javax.faces:jsf-api:jar': Error getting POM for 'javax.faces:jsf-api' from the repository: Error transferring file
javax.faces:jsf-api:1.1_01:pom
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
ppw-missing (https://cvs.peopleware.be/projects/maven/maven2/repository),
ppw-libraries (https://cvs.peopleware.be/projects/JavaLibraries/maven2-repository)
at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:114)
at org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:276)
... 23 more
Caused by: org.apache.maven.project.ProjectBuildingException: Error getting POM for 'javax.faces:jsf-api' from the repository: Error transferring file
javax.faces:jsf-api:1.1_01:pom
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
ppw-missing (https://cvs.peopleware.be/projects/maven/maven2/repository),
ppw-libraries (https://cvs.peopleware.be/projects/JavaLibraries/maven2-repository)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:411)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:346)
at org.apache.maven.project.artifact.MavenMetadataSource.retrieve(MavenMetadataSource.java:101)
... 24 more
Caused by: org.apache.maven.artifact.resolver.ArtifactResolutionException: Error transferring file
javax.faces:jsf-api:1.1_01:pom
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
ppw-missing (https://cvs.peopleware.be/projects/maven/maven2/repository),
ppw-libraries (https://cvs.peopleware.be/projects/JavaLibraries/maven2-repository)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:140)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:63)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:380)
... 26 more
Caused by: org.apache.maven.wagon.TransferFailedException: Error transferring file
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:85)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:68)
at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:367)
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:282)
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:244)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:124)
... 28 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA12275)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA12275)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:626)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(DashoA12275)
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:71)
... 33 more
Caused by: sun.security.validator.ValidatorException: No trusted certificate found
at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:304)
at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:107)
at sun.security.validator.Validator.validate(Validator.java:202)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(DashoA12275)
at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(DashoA12275)
... 44 more
</samp>
This is weird, because the ssl code used is the same as used by maven 1, no?
<x-tad-smaller>Met vriendelijke groeten,
Jan Dockx
</x-tad-smaller><x-tad-smaller>
PeopleWare NV - Head Office</x-tad-smaller><x-tad-smaller>
Cdt.Weynsstraat 85
B-2660 Hoboken
Tel: +32 3 448.33.38
Fax: +32 3 448.32.66 </x-tad-smaller><x-tad-bigger>
</x-tad-bigger><x-tad-smaller>
PeopleWare NV - Branch Office Geel</x-tad-smaller><x-tad-smaller>
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25</x-tad-smaller><x-tad-bigger>
</x-tad-bigger><x-tad-smaller>
http://www.peopleware.be/
</x-tad-smaller><x-tad-smaller>http://www.mobileware.be/</x-tad-smaller>
smime.p7s
Description: S/MIME cryptographic signature