0

I'm writing a standalone EJB client for JBoss 7.1 and as suggested I'm using the following dependency:

<dependency>
    <groupId>org.jboss.as</groupId>
    <artifactId>jboss-as-ejb-client-bom</artifactId>
    <type>pom</type>
    <version>7.1.1.Final</version>
</dependency>

This works as expected in Maven, however when used in Gradle like so:

dependencies {
    compile 'org.jboss.as:jboss-as-ejb-client-bom:7.1.1.Final'
}

It fails with:

Could not find group:org.jboss, module:jboss-remote-naming, version:1.0.2.Final.

What is the reason for different behavior of Gradle vs. Maven?

5
  • the checked repositories could be different. mvn help:effective-settings will show the list for maven. I don't know haw gradle works there.
    – wemu
    Sep 12, 2012 at 11:03
  • Do you have the central maven repository set up? gradle.org/docs/current/userguide/… Sep 12, 2012 at 11:59
  • Yeah, using mavenCentral(). Dependencies other than jboss-remote-naming download correctly. Funny, if you check mvnrepository.com/artifact/org.jboss.as/jboss-as-ejb-client-bom/… and click jboss-remote-naming, you get 404. Is it possible that the repository is broken?
    – Docent
    Sep 12, 2012 at 13:23
  • wemu, indeed seems that Maven by default uses repo.maven.apache.org while Gradle with mavenCentral() uses repo1.maven.org
    – Docent
    Sep 12, 2012 at 13:47
  • If you get a 404 then the artifact doesn't exist. What potentially happened in your Maven build is that it was resolvable at some point of time and you now have it in your local cache. I'd try to delete the artifact from ~/.m2 and try to run the Maven build again. Sep 12, 2012 at 20:22

2 Answers 2

0

Well the dependency you declare in Maven points to a pom packaging component, and the one in Gradle points to a jar. However there is no jar with this project since it is a pom packaging component so Gradle obviously fails.

http://search.maven.org/#browse%7C351478366

Using Gradle you probably have to either declare a dependency to the pom somehow (not sure if that is possible) or add the dependencies from the pom to your project yourself.

http://search.maven.org/remotecontent?filepath=org/jboss/as/jboss-as-ejb-client-bom/7.1.3.Final/jboss-as-ejb-client-bom-7.1.3.Final.pom

0

Use the @pom type:

dependencies {
    compile 'org.jboss.as:jboss-as-ejb-client-bom:7.1.1.Final@pom'
}
0

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.