views:

741

answers:

1

Hi All,

I'm developing a small web frontend in Grails. It is basically a "ultra light-weight" client app that is connected async through JMS.

I have two dependencies in the project that I would like to pull from a Maven repository. They is activemq and acme-adapter-api, a inhouse dependency, not available at the remote repository.

I set up my BuildConfig.groovy (Grails 1.2M4) file like this, in order to access my dependencies:

repositories {
  grailsPlugins()
  grailsHome()
  mavenCentral()
  mavenLocal('D:/maven-repo')
} dependencies {
  compile 'org.apache.activemq:apache-activemq:4.1.1'
  compile 'com.acme:acme-adapter-api:1.3-SNAPSHOT'
}

When I run grails dependency-report, I can see this line concerning the acme-adapter-api, for example:

acme-adapter-api by com.acme
108 kB (0 kB downloaded, 108 kB in cache)

When I try to run grails compile, I don't get lucky, as it then complains it is unable to resolve the classes from the com.acme group.

Interestingly the activemq dependencies don't seem to be a problem...

The difference is, that the acme dependencies are not in mavenCentral(), but only in mavenRepo "D:/maven-repot". So I thought: "Maybe it is not picking it up from the local disk then..." and changed the version to some funny (1.999-SNAPSHOT) value that doens't exist in the BuildConfig.groovy file. When running grails compile again, the command timed out, saying, that version could not be found:

UNRESOLVED DEPENDENCIES D:/maven-repo: unable to get resource for com/acme#acme-adapter-api;1.999-SNAPSHOT

So obviously the local dependency gets resolved but somehow not applied in the next step, compilation...

Thanks! Raoul

A: 

It turned out that the problem was then non empty cache for the artifact. While the activemq jar file was untouched, the acme-adapter-api.jar was in fact many times changed but without increasing the maven build id, 1.3, in the above case.

I could fix it, when I increased the build number to 1.4-SNAPSHOT...

Two question remain:

  1. Isn't the maven contract to always fetch SNAPSHOT versions, for the exact same reason?
  2. How to forcefully empty the cache? And where is it?

I will open a new question to answer part 2 here

raoulsson
I just ran into the same problem. The SNAPSHOT dependencies are not reloaded after the first time. This is a huge issue during development. :/ Grrr.
Mike