English 中文(简体)
Using Maven to download drools sources
原标题:

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.





相关问题
In Eclipse, why doesn t "Show In" appear for non-Java files?

If I have a *java file open, I can right click on the source, scroll down to "Show In (Alt-Shift-W)", and select Navigator. If I have an *xml, *jsp, or pretty much anything besides a Java source ...

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

How to copy multiple projects into single folder in eclipse

I have two projects, Project1 and Project2. Now i want to copy this projects into eclipse workspace but i want these projects to be in a single folder like below. Eclipse Workspace -> Project -> ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

热门标签