Issue Details (XML | Word | Printable)

Key: NUCMAVEN-27
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Chris
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Tools : Maven plugin

Maven build failure, missing dependency javax.jdo:jdo-api:jar:3.1-SNAPSHOT-20110926

Created: 28/Feb/12 04:29 PM   Updated: 14/Jun/12 01:28 PM   Resolved: 01/Mar/12 04:55 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment:
VM with SL5 x86_64
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_29

Severity: Production


 Description  « Hide
You have for org.datanucleus:maven-datanucleus-plugin:maven-plugin:2.2.1 a dependency on the latest jdo-api.

cat ~/.m2/repository/org/datanucleus/maven-datanucleus-plugin/2.2.1/maven-datanucleus-plugin-2.2.1.pom

shows:
....
        <dependency>
            <groupId>javax.jdo</groupId>
            <artifactId>jdo-api</artifactId>
            <version>[3.0, )</version>
            <scope>runtime</scope>
        </dependency>

...

      <repositories>
        <repository>
            <id>DN_M2_Repo</id>
            <url>http://www.datanucleus.org/downloads/maven2/&lt;/url>
        </repository>
      </repositories>

We get when building:
========Maven build error========================

Downloading: http://repo1.maven.org/maven2/javax/jdo/jdo-api/3.1-SNAPSHOT-20110926/jdo-api-3.1-SNAPSHOT-20110926.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) javax.jdo:jdo-api:jar:3.1-SNAPSHOT-20110926

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=javax.jdo -DartifactId=jdo-api -Dversion=3.1-SNAPSHOT-20110926 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=javax.jdo -DartifactId=jdo-api -Dversion=3.1-SNAPSHOT-20110926 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
   1) org.datanucleus:maven-datanucleus-plugin:maven-plugin:2.2.1
   2) javax.jdo:jdo-api:jar:3.1-SNAPSHOT-20110926

----------
1 required artifact is missing.

for artifact:
  org.datanucleus:maven-datanucleus-plugin:maven-plugin:2.2.1

from the specified remote repositories:
  dcache.download.repository (https://download.dcache.org/nexus/content/groups/public),
  central (http://repo1.maven.org/maven2),
  DN_M2_Repo (http://www.datanucleus.org/downloads/maven2/),
  freehep-maven (http://java.freehep.org/maven2),
  dcache.repository (http://www.dcache.org/nexus/content/groups/public)

===End=====Maven build error========================

While the http://www.datanucleus.org/downloads/maven2/javax/jdo/jdo-api/3.1-SNAPSHOT-20110926/ has:
...
[ ] jdo-api-3.1-SNAPSHOT-20110926.jar 27-Sep-2011 19:41 204K
[ ] jdo-api-3.1-SNAPSHOT-20110926.pom 27-Sep-2011 19:41 5.6K
...

We are building against a tag which should prevent using SNAPSHOT version of dependencies, but still it is trying to pull a snapshot.
The same problem is described somewhere else: https://issues.onehippo.com/browse/REPO-242 and was fixed on there side. So maybe it is fixable on our side, but I can not find how. Please help in this case

Otherwise:
I see the problem in the version interval definition and the fact that we have no control
        <dependency>
            <groupId>javax.jdo</groupId>
            <artifactId>jdo-api</artifactId>
            !!!!! <version>[3.0, )</version> !!!!!!
            <scope>runtime</scope>
        </dependency>

I must admit, I do not completely understand what exactly the problem is, but this is my interpretation:
Since I am building against a tag, there should be no use of snapshots anywhere. This is a fact.

Question1: Why is it still pulling snapshots? This might then be a problem on our side, which I could not identify or on your side that the repo http://www.datanucleus.org/downloads/maven2/javax/jdo contains snapshots and I do not have control over what is pulled as a dependency on your side.

Question2: It is trying to pull a snapshot jar that is there, but is not able to download it, which is strange.

Kind regards. Christian



Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 28/Feb/12 04:59 PM
Presumably Maven, being decidedly substandard wrt separating SNAPSHOT and other artifacts, has a problem with SNAPSHOT jars being in the DN repo (even though they are all referenced in all of the necessary files). The problem stems from Apache JDO being incredibly slow at doing releases, hence we have to provide snapshots of JDO jars. You could easily restrict the jdo-api jar to 3.0.1 if you don't want SNAPSHOTs.

Chris added a comment - 01/Mar/12 04:39 PM
Hi Andy,

thank you for the quick response. Adding the static dependency to our pom.xml actually solved the issue for us. I post the whole plugin conf for others to be quicker at solving such an issue than I was.

Thanks again. Christian

<plugin>
              <groupId>org.datanucleus</groupId>
              <artifactId>maven-datanucleus-plugin</artifactId>
              <version>2.2.1</version>
              <configuration>
                  <verbose>false</verbose>
                  <metadataIncludes>**/*.jdo</metadataIncludes>
              </configuration>
              <executions>
                  <execution>
                      <phase>process-classes</phase>
                      <goals>
                          <goal>enhance</goal>
                      </goals>
                  </execution>
              </executions>
              <dependencies>
                  <dependency>
                      <groupId>org.datanucleus</groupId>
                      <artifactId>datanucleus-core</artifactId>
                      <version>2.2.4</version>
                  </dependency>
                  <dependency>
                      <groupId>org.dcache</groupId>
                      <artifactId>logback-test-config</artifactId>
                      <version>${project.version}</version>
                  </dependency>
                  <dependency>
                      <groupId>javax.jdo</groupId>
                      <artifactId>jdo-api</artifactId>
                      <version>3.0.1</version>
                  </dependency>
              </dependencies>
          </plugin>