Maven Integration for Eclipse

"Add dependency" feature should use the artifact <type> when adding the dependency into the pom

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.9.2
  • Fix Version/s: 0.9.7
  • Component/s: None
  • Labels:
    None
  • Environment:
    Eclipse 3.3.*
  • Number of attachments :
    4

Description

When adding a dependency, whatever the artefact type chosen from the repository, it is added whithout the type:

<dependency>
<groupId>a.b.c</groupId>
<artifactId>myArtefact</artifactId>
<version>x.y.z</version>
</dependency>

this is a pain, because, if you chose a pom, then a maven build, or the dependency resolver wont find it.
Therefore the type should be explicitely set from what the indexer can find in the repository (pom, jar, ejb, war, etc. )

<dependency>
<groupId>a.b.c</groupId>
<artifactId>myArtefact</artifactId>
<version>x.y.z</version>
<type>pom,ejb,war, ... or jar ...</type>
</dependency>

Christian-Luc

Issue Links

Activity

Hide
Eugene Kuleshov added a comment -

Christian-Luc, can you please create test projects with "pom,ejb,war, or jar" type and then another one that uses those. It would help use to investigate and provide solution for this. Thanks.

Show
Eugene Kuleshov added a comment - Christian-Luc, can you please create test projects with "pom,ejb,war, or jar" type and then another one that uses those. It would help use to investigate and provide solution for this. Thanks.
Hide
christian-Luc Houze added a comment -

this is a very simple project the packaging is "pom": it groups two dependencie:

<?xml version="1.0" encoding="UTF-8"?>
<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>LibraryPom</groupId>
<artifactId>LibraryPom</artifactId>
<packaging>pom</packaging>
<version>0.0.1</version>
<description>Just a pom that groups dependencies</description>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>oro</groupId>
<artifactId>oro</artifactId>
<version>2.0.8</version>
</dependency>
</dependencies>
</project>

Show
christian-Luc Houze added a comment - this is a very simple project the packaging is "pom": it groups two dependencie: <?xml version="1.0" encoding="UTF-8"?> <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>LibraryPom</groupId> <artifactId>LibraryPom</artifactId> <packaging>pom</packaging> <version>0.0.1</version> <description>Just a pom that groups dependencies</description> <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.1.2</version> </dependency> <dependency> <groupId>oro</groupId> <artifactId>oro</artifactId> <version>2.0.8</version> </dependency> </dependencies> </project>
Hide
christian-Luc Houze added a comment -

Same as previous screen capture EXCEPT that version 0.9.2 is used here, and the screen shows a jar instead of a pom (there is no jar in the repository !)

Show
christian-Luc Houze added a comment - Same as previous screen capture EXCEPT that version 0.9.2 is used here, and the screen shows a jar instead of a pom (there is no jar in the repository !)
Hide
christian-Luc Houze added a comment -

SimpleJar is a very simple project: no dependency

Show
christian-Luc Houze added a comment - SimpleJar is a very simple project: no dependency
Hide
christian-Luc Houze added a comment -

Now, you have the two projects attached:
LibraryPom
SimpleJar

1) import both projects
2) install LibraryPom
3) index repository
4) Maven add dependency for SimpleJar
5) search for LibraryPom
=> see that LibraryPom will show up as a jar (it should be a pom !) Note that as of version 0.0.11 it showed up as pom (cf screen capture)
6) choose LibraryPom
7) it is included in SimpleJar as the dependency below:
<dependencies>
<dependency>
<groupId>LibraryPom</groupId>
<artifactId>LibraryPom</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>

This will result into a build failure as the default type is jar and LibraryPom.jar does not exist

Therefore the dependency type should/must be explicitely set.

I wish this is what is exepected as enough test case ?

Thanks,

Christian-Luc

Show
christian-Luc Houze added a comment - Now, you have the two projects attached: LibraryPom SimpleJar 1) import both projects 2) install LibraryPom 3) index repository 4) Maven add dependency for SimpleJar 5) search for LibraryPom => see that LibraryPom will show up as a jar (it should be a pom !) Note that as of version 0.0.11 it showed up as pom (cf screen capture) 6) choose LibraryPom 7) it is included in SimpleJar as the dependency below: <dependencies> <dependency> <groupId>LibraryPom</groupId> <artifactId>LibraryPom</artifactId> <version>0.0.1</version> </dependency> </dependencies> This will result into a build failure as the default type is jar and LibraryPom.jar does not exist Therefore the dependency type should/must be explicitely set. I wish this is what is exepected as enough test case ? Thanks, Christian-Luc
Hide
Herve Boutemy added a comment -

fixed in r404

Show
Herve Boutemy added a comment - fixed in r404
Hide
Marvin Froeder added a comment -

Create a dependency that exists only as a pom at repository, like this one:
http://repository.sonatype.org/content/groups/flex/com/adobe/flex/compiler/3.2.0.3958/

Then, add it using add depdency.

Got the following:
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>3.2.0.3958</version>
<classifier>pom</classifier>
</dependency>

It should have TYPE pom, not the CLASSIFIER.

Got this at 0.9.7.200812311031

Show
Marvin Froeder added a comment - Create a dependency that exists only as a pom at repository, like this one: http://repository.sonatype.org/content/groups/flex/com/adobe/flex/compiler/3.2.0.3958/ Then, add it using add depdency. Got the following: <dependency> <groupId>com.adobe.flex</groupId> <artifactId>compiler</artifactId> <version>3.2.0.3958</version> <classifier>pom</classifier> </dependency> It should have TYPE pom, not the CLASSIFIER. Got this at 0.9.7.200812311031
Hide
Anton Kraev added a comment -

Fixed the typo. Hard to believe that it was there for so long.

Show
Anton Kraev added a comment - Fixed the typo. Hard to believe that it was there for so long.
Hide
Marvin Froeder added a comment -

It happens

Show
Marvin Froeder added a comment - It happens

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: