Build dependency issue with Grails and Maven
-
13-11-2019 - |
Pregunta
I'm trying to integrate Google's JSON RPC library in my Grails project. The Maven configuration is here, I also took the snippet from the site...
<dependencies>
<dependency>
<groupId>org.json.rpc</groupId>
<artifactId>jsonrpc</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>json-rpc</id>
<url>http://json-rpc.googlecode.com/svn/mavenrepo</url>
</repository>
</repositories>
So, I took the above Maven config and placed it in my project's BuildConfig.groovy
..
grails.project.dependency.resolution = {
repositories{
mavenRepo "http://json-rpc.googlecode.com/svn/mavenrepo"
}
dependencies {
compile "org.json.rpc:jsonrpc:1.0"
}
}
When I refresh project dependencies, Grails throws this error..
org.json.rpc#jsonrpc;1.0: java.text.ParseException: inconsistent module descriptor file found in 'http://json-rpc.googlecode.com/svn/mavenrepo/org/json/rpc/jsonrpc/1.0/jsonrpc-1.0.pom': bad revision: expected='1.0' found='1.0-SNAPSHOT';
I'm not sure if this is a problem with the Google repo or with my config. Based on the error message it appears that Grails was expecting 1.0-SNAPSHOT
from the pom, so I change my build file to compile "org.json.rpc:jsonrpc:1.0-SNAPSHOT"
, but that results in a "module not found" error message.
Solución
It looks like the pom file from the repository has issues:
<groupId>org.json.rpc</groupId>
<artifactId>jsonrpc</artifactId>
<name>JSON-RPC</name>
<version>${jsonrpc.version}</version>
<properties>
<jsonrpc.version>1.0-SNAPSHOT</jsonrpc.version>
<java.version>1.5</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
The artifact is version 1.0 but the version from the pom file is defined as 1.0-SNAPSHOT.