Uploaded image for project: 'Apache Tomcat Maven Plugin'
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-240

Artifacts with same artifactID but different groupID are skipped

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.2
    • commons-lib
    • None
    • all

    Description

      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:

                              String fileName = artifact.getFile().getName();
                              if ( !fileInClassLoaderEntries.contains( fileName ) ) {
                                         // add the artifact to the classpath
                              }
      

      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:

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

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

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            olamy Olivier Lamy
            paranoiabla Petar Tahchiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment