4

I'm currently busy migrating fairly old projects from Ant to Gradle. This includes replacing the lib directories with equivalent Gradle dependency management.

Currently I'm having trouble with Maven Central. Some dependencies (I found at least 3) have a POM file but the corresponding JAR file is missing e.g.

Is this a recent Maven Central problem or were these JARs never available on Maven Central?

PS I could use newer versions of the libaries but I would prefer to first get the project working with the current dependencies before updating.

Heinrich Filter
  • 5,760
  • 1
  • 33
  • 34

2 Answers2

1

If you want Gradle to look for a POM in one repository, and the corresponding Jar in another repository, you'll have to do:

repositories {
  url 'http://repo1.maven.org/maven2'
  artifactUrls 'http://repository.jboss.org/nexus/content/groups/public-jboss'
}

Configure artifactUrls accordingly..

Kanti
  • 1,062
  • 1
  • 10
  • 27
0

Some organizations prevent publishing of binary content on public forums. For example, Oracle prevents publishing of JAR files containing its JDBC drivers on online forums, which includes Maven Central. See this as an example. For some time, JAVAX JARs were similarly not published to Maven Central.

You could change your dependency to javax.mail:javax.mail-api:1.5.2, which is the latest available version on Maven Central.

manish
  • 19,695
  • 5
  • 67
  • 91
  • 1
    Thanks! I still don't understand why they would publish the metadata (pom.xml) if they can't add the jar. It gives the impression that the dependency is available (e.g. mvnrepository.com search finds it) but then the build fails when you try to retrieve the jar file. – Heinrich Filter Apr 02 '15 at 08:54