Petar Tahchiev created MTOMCAT-240:
--------------------------------------

             Summary: Artifacts with same artifactID but different groupID are 
skipped
                 Key: MTOMCAT-240
                 URL: https://issues.apache.org/jira/browse/MTOMCAT-240
             Project: Apache Tomcat Maven Plugin
          Issue Type: Bug
          Components: commons-lib
    Affects Versions: 2.1
         Environment: all
            Reporter: Petar Tahchiev
            Assignee: Olivier Lamy (*$^¨%`£)
             Fix For: 2.2
         Attachments: MTOMCAT-240.patch

Hi guys,

I have the following situation: my classpath includes the following artifacts:
1) artifactA in group com.mygroup
2) artifactA in group com.myothergroup.

Looking in DefaultClassLoaderEntriesCalculator.java on line 120 we see the 
following:
{code}
                        String fileName = artifact.getFile().getName();
                        if ( !fileInClassLoaderEntries.contains( fileName ) ) {
                                   // add the artifact to the classpath
                        }
{code}

So in my case both artifacts are resolved as artifactA-1.0-SNAPSHOT.jar so the 
second one gets omitted. I have chaged to code to simply include the categoryID 
like this: 

{code}
                        String fileName = artifact.getGroupId() + "-" + 
artifact.getFile().getName();
                        if ( !fileInClassLoaderEntries.contains( fileName ) ) {
                                  //add to classpath
                        }
{code}

and it works like a charm.
You can find the patch attached. Please review it and apply.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to