Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-430

Dependency plugin does not seem to respect profile specific copy goals

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Auto Closed
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: copy
    • Labels:
      None
    • Environment:
      Mac OSX Mountain Lion 10.8.4

      Description

      I am using the dependency plugin inside a swf type project that builds using Maven. Ant is currently being used to copy the target files to the destination directories, but my hope is to use the dependency plugin so that everything is included inside the POM.
      Here's my rough POM structure:

      <!-- Below build properties are listed outside of 'profile' since they are not supported inside a 'profile' tag.
      <build>
      <sourceDirectory>dir</sourceDirectory>
      <finalName>${project.name}</finalName>
      </build>

      <profiles>
      <profile>
      <id>profile1</id>
      <build>
      <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      .
      <goal>copy</goal>
      .
      <configuration> ... </configuration>
      <outputDirectory>DIR1</outputDirectory>
      </plugin>
      </plugins>
      </build>
      </profile>

      <profile>
      <id>profile2</id>
      <build>
      <plugins>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      .
      <goal>copy</goal>
      .
      <configuration> ... </configuration>
      <outputDirectory>DIR2</outputDirectory>
      </plugin>
      </plugins>
      </build>
      </profile>

      </profiles>

      What I am seeing:

      When I run: 'mvn -U clean install -P profile1', the execution for profile1 proceeds and the files are copied to DIR1 as expected.

      When I run: 'mvn -U clean install -P profile2', the execution for profile1 and profile2 both happen and the file meant to go into DIR2 is also copied into DIR1. This is undesirable.

      Please let me know if any further details may be helpful here. Thanks for your time.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tskamaldeep Kamaldeep Tumkur
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: