Как удалить artifactItems из maven перед сборкой - PullRequest
0 голосов
/ 10 октября 2018

Мой мавенский пом выглядит следующим образом

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>x</groupId>
    <artifactId>x</artifactId>
    <version>x</version>
  </parent>

  <groupId>x</groupId>
  <artifactId>x</artifactId>
  <packaging>pom</packaging>

  <repositories>
    <repository>
      <id>x</id>
      <url>x</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <build>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-web</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>xx.xx.xx</groupId>
                  <artifactId>xx</artifactId>
                  <version>xx</version>
                  <classifier>release</classifier>
                </artifactItem>

                <artifactItem>
                  <groupId>xx.xx.xx</groupId>
                  <artifactId>xx</artifactId>
                  <version>xx</version>
                  <type>war</type>
                </artifactItem>

                <artifactItem>
                  <groupId>xx.xx.xx</groupId>
                  <artifactId>xx</artifactId>
                  <version>xx</version>
                  <type>war</type>
                </artifactItem>
              </artifactItems>
              <outputDirectory>/target/output</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>

Я хотел удалить упомянутые элементы артефакта перед выполнением сборки, чтобы он загружал последние версии из репозитория.

Текущее поведение таково, есливерсия присутствует в локальном репозитории, она не проверяет, присутствует ли более новая версия.

Я пробовал опцию -U и опцию зависимости очистки &&, но не wprk

...