开发者

Using Maven to download drools sources

开发者 https://www.devze.com 2022-12-15 00:07 出处:网络
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/java

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?


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">
  <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</url>
  <repositories>
    <repository>
      <id>repository.jboss.org</id>
      <url>http://repository.jboss.org/maven2</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>snapshots.jboss.org</id>
      <url>http://snapshots.jboss.org/maven2</url>
      <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).


Before drools 5.2.0.Final (released 2 years ago), the maven poms were a mess and source jars didn't get uploaded correctly. That's fixed in 5.2, 5.3, 5.4, 5.5, ...

Upgrade to drools 5.5.0.Final.

0

精彩评论

暂无评论...
验证码 换一张
取 消