1

I used to work with CRXDE Eclipse now I am migrating the project to Maven. I made a list of all dependencies. And put them in the bundle/pom.xml. One of them being

        <dependency>
            <groupId>com.day.cq.dam</groupId>
            <artifactId>cq-dam-api</artifactId>
            <version>5.5.0</version>                
        </dependency>  

And I also added repository information in the Parent POM.xml

 <repository>
    <id>adobe-releases</id>
    <url>https://repo.adobe.com/nexus/content/groups/public/</url>
  </repository>

As Mentioned Here

All other jars are downloaded except this jar. This is the error when I try to install

[ERROR] Failed to execute goal on project hrportal-bundle: Could not resolve dep
endencies for project hrporatal:hrportal-bundle:bundle:1.1.0-SNAPSHOT: Failed to
 collect dependencies at com.day.cq.dam:cq-dam-api:jar:5.5.0: Failed to read art
ifact descriptor for com.day.cq.dam:cq-dam-api:jar:5.5.0: Could not transfer art
ifact com.day.cq.dam:cq-dam-api:pom:5.5.0 from/to adobe (http://repo.adobe.com/n
exus/content/groups/public): java.lang.RuntimeException: Could not generate DH k
eypair: Prime size must be multiple of 64, and can only range from 512 to 1024 (
inclusive) -> [Help 1]

When I checked the .m2 folder I couldn't see the downloaded JAR, I just see one file that has the following written inside it.

#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Mon Jan 05 15:19:27 IST 2015
http\://repo.maven.apache.org/maven2/.lastUpdated=1420449912904
https\://code.lds.org/nexus/content/groups/main-repo/.error=
@default-https\://repo.adobe.com/nexus/content/groups/public/.lastUpdated=1420451367149
http\://repo.maven.apache.org/maven2/.error=
https\://code.lds.org/nexus/content/groups/main-repo/.lastUpdated=1420449911681
@default-http\://repo.adobe.com/nexus/content/groups/public/.lastUpdated=1420451366718
https\://repo.adobe.com/nexus/content/groups/public/.error=Could not transfer artifact com.day.cq.dam\:cq-dam-api\:pom\:5.5.0 from/to adobe-releases (https\://repo.adobe.com/nexus/content/groups/public/)\: java.lang.RuntimeException\: Could not generate DH keypair
http\://repo.adobe.com/nexus/content/groups/public/.error=Could not transfer artifact com.day.cq.dam\:cq-dam-api\:pom\:5.5.0 from/to adobe (http\://repo.adobe.com/nexus/content/groups/public)\: java.lang.RuntimeException\: Could not generate DH keypair
 

** And what is Scope provided In Maven?**

7 Answers 7

1

I am still not able to download the jar. I found a work around.

I downloaded the JAR Manually and installed it in Maven using following command.

mvn install:install-file -DgroupId=com.day.cq.dam -DartifactId=cq-dam-api -Dversion=5.5.0 -Dpackaging=jar -Dfile=C:\Users\okaunds\Desktop\cq-dam-api-5.5.0.jar

And then I ran my install command for CQ project. And it worked.

Any inputs on why it isn't downloading from the repository are welcome.

5
  • 1
    what version of java are you using? It looks like you are hitting a bug in java, as detailed in this answer: stackoverflow.com/a/6852095/1570834
    – DB5
    Jan 5, 2015 at 11:55
  • 1
    by the way for details on the provided scope see the following page: maven.apache.org/guides/introduction/….
    – DB5
    Jan 5, 2015 at 11:57
  • @DB5 I am using Java Version 6.
    – Oliver
    Jan 5, 2015 at 11:58
  • 2
    Java6 will probably explain the error. This bug was only fixed with Java8. It would be interesting to know what would happen if you moved to Java8, otherwise if that is not possible, your workaround of manually installing the jar is probably the best solution.
    – DB5
    Jan 5, 2015 at 12:51
  • Faced the same issue & fixed it via installing the plugin manually. Thanks for the solution.
    – msg
    Mar 17, 2016 at 10:17
1

If you look very closely at the error message, you'll see that you told Maven to download via HTTPS (with SSL) but Maven actually tries to download via HTTP (without SSL).

If I try this, then my browser is redirected to HTTPS. My guess is that the HTTP wagon gets confused by the redirect or that you have a Nexus proxy/mirror somewhere which isn't configured correctly.

Try to find out why Maven is mixing the protocols. Somewhere in your POM or on Nexus, the must be a http://repo.adobe.com/ URL. Replace this with https://...

6
  • What you said makes a lot of sense.!
    – Oliver
    Jan 7, 2015 at 5:00
  • @Oliver: Try to find out why Maven is mixing the protocols. Somewhere in your POM or on Nexus, the must be a http://repo.adobe.com/ URL. Replace this with https://... Jan 7, 2015 at 8:57
  • I did that but it still refuses to download from repo.adobe.com.
    – Oliver
    Jan 7, 2015 at 9:54
  • In that case, you didn't fix it everywhere. You have to get rid of the http://. Jan 8, 2015 at 10:40
  • I replaced all the adobe repos with https and then tried it again with http. But it still shows the same error. I am somehow managing my work by doing manual jar install. Another thing is that, adobe's jars get downloaded if the jar's <repository> id is <id>adobe</id> but if the jar is in <id>adobe-releases<id> then it doesn't get downloaded.
    – Oliver
    Jan 9, 2015 at 6:06
0

This might be http://jira.codehaus.org/browse/MNG-4838, where Maven, prior to V3.0.4, fails to follow a 301 redirect from http to https. If that's the case, upgrading to Maven 3.0.4 or later should fix it.

1
  • My Maven version is 3.2.1
    – Oliver
    Jan 6, 2015 at 12:02
0

What I found is that there is a problem with the JRE but not with the JDK...

If you set your JAVA_HOME & put the bin folder for this at the front of your path - you should find this works.

In my case, on my mac:

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk PATH=${JAVA_HOME}/bin:$PATH

(Your JDK version may vary) Then running the Maven checkout should work without the dreaded "Could not generate DH keypair" error

(This fixed the issue I was having with Java 8 & Maven 3.2.5)

0

I had this issue using JDK 6, switched to 7 and it went away!

0

As as been answered here Java: Why does SSL handshake give 'Could not generate DH keypair' exception? the true problem is that older java version did not support DH key above 1024, and you will need to use Java 8 that includes a fix for this.

0

For others who encounter this problem, you can also choose to trust SSL endpoints by relaxing the checks on the certificates:

export MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.