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

copy does not fetch most recent snapshot when -U is set

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: copy
    • Labels:
      None
    • Environment:

      Description

      The copy goal seems to ignore the -U command line option. With the configuration below and -U set, the most recent snapshot of an artifact is not fetched if there is a reasonably new (in my case a few hours) snapshot version cached in the local repository. This is not sufficient. Afaik -U is supposed to force the check for new snapshot versions.

      When I delete the local snapshot artifact, the MOJO logs the message

      [INFO] snapshot example-group:example-artifact:0.1.0-SNAPSHOT: checking for updates from example-nexus
      

      However no such line is printed out when there is an outdated local snapshot artifact and -U is set.

      Example configuration:

      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.1</version>
            <executions>
              <execution>
                <id>copy-snapshot</id>
                <phase>compile</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>example-group</groupId>
                      <artifactId>example-artifact</artifactId>
                      <version>0.1.0-SNAPSHOT</version>
                      <overWrite>true</overWrite>
                    </artifactItem>
                  </artifactItems>
                  <stripVersion>true</stripVersion>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      

      Btw. copy-dependencies seems to honour the -U option, but copy-dependencies may not be appropriate for all people's use cases.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bentmann Benjamin Bentmann
                Reporter:
                tobias.oberlies Tobias Oberlies
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: