[ 
https://issues.apache.org/jira/browse/MNG-5979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15150425#comment-15150425
 ] 

Rami Ojares commented on MNG-5979:
----------------------------------

I think we are onto something.
I tried to find which version I am using but it seems very difficult.

In my plugin I define a dependency like this:

<dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-project</artifactId>
    <version>3.0-alpha-2</version>
</dependency>

But I can not find anywhere to what version of maven-core javadoc api this 
plugin refers to.
So I decided to look at the bytecode and there I can see that in 
org.apache.maven:maven-project:3.0-alpha-2 is defined as
Set getPluginArtifacts();
whereas in my mave 3.3.9 installation it is indeed defined as
Set<Artifact> getPluginArtifacts();

Since 3.0-alpha-2 seems like the newest release of maven-project, how can I use 
the api version 3.3.9 from my plugin?

> Maven distribution is not compiled with generics
> ------------------------------------------------
>
>                 Key: MNG-5979
>                 URL: https://issues.apache.org/jira/browse/MNG-5979
>             Project: Maven
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.3.9
>         Environment: linux, java 8
>            Reporter: Rami Ojares
>            Assignee: Karl Heinz Marbaise
>
> Reading maven javadoc api it contains generic types.
> But when in my Mojo I try to use them the collections seem not to know 
> anything about generics.
> Example:
> project.getPluginArtifacts() returns List not List<Artifacts>
> I can still cast the Objects from the list to Artifact type.
> But
> List<Artifact> al = project.getPluginArtifacts();
> will produce an error.
> I simply downladed compiled version of maven 3.3.9 from maven's own site.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to