views:

1051

answers:

1

I'm new to maven and drools, so this could be obvious...

I'm trying to work off of the drools snapshot repository using maven/eclipse. I'd like to be able to link the sources/javadoc when updating using maven but I keep getting messages similar to:

Can't download java-source for artifact org.drools:drools-process-task:5.1.0.20091223.193911-177

Any idea what I'm doing wrong?

+1  A: 

I created a simple project to reproduce this error and, using the following pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany</groupId>
  <artifactId>maven-drools-testcase</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>maven-drools-testcase</name>
  <url>http://maven.apache.org&lt;/url&gt;
  <repositories>
    <repository>
      <id>repository.jboss.org</id>
      <url>http://repository.jboss.org/maven2&lt;/url&gt;
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>snapshots.jboss.org</id>
      <url>http://snapshots.jboss.org/maven2&lt;/url&gt;
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.7</version>
      <scope>test</scope>
    </dependency>
    <!--
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-process-task</artifactId>
      <version>5.1.0.M1</version>
    </dependency>
    -->
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-process-task</artifactId>
      <version>5.1.0.SNAPSHOT</version>
    </dependency>
  </dependencies>
</project>

I wasn't indeed able to download the sources from eclipse (which are in the repository!). This works fine with version 5.1.0.M1 though so there must be a problem with the JBoss Snapshots Repository (maybe the metadata?). You should open an issue at Drools Jira.

UPDATE: I did a bit more testing and, strangely, if I add the following dependency in the pom.xml:

<dependency>
  <groupId>org.drools</groupId>
  <artifactId>drools-process-task</artifactId>
  <version>5.1.0.SNAPSHOT</version>
  <classifier>sources</classifier>
</dependency>

The sources JAR gets properly downloaded.

As I said, I'm don't know exactly what is the root cause of the problem and wonder if this is not a problem with m2eclipse after all. Actually, you should maybe try to open an issue in M2Eclipse Jira first and see if they detect a problem with their code or with the JBoss Snapshot repository (in which case they will send you to Drools Jira I guess).

Pascal Thivent
Thanks! Being new to drools/maven I didn't want to preemptively open an issue.
Daniel