Rems
Rems

Reputation: 26

Maven plugin wagon do not consider my parameters and version of plugins

i have a maven project but i want tu run specific part with maven profile with calling specific plugin i do that:

mvn -Pcve-report org.codehaus.mojo:wagon-maven-plugin:upload -T0.8C -DskipTests

(this syntax work with others plugins) But my parameters (version, url etc...) are not considered by maven and return:

[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload (default-cli) on project project-script: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload are missing or invalid -> [Help 1]
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload (default-cli) on project project-persistence-base-tests: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload are missing or invalid -> [Help 1]
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload (default-cli) on project project-annotation-processor-tests: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload are missing or invalid -> [Help 1]
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload (default-cli) on project project: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload are missing or invalid -> [Help 1]
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload (default-cli) on project project-annotation-processor: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload are missing or invalid -> [Help 1]
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload (default-cli) on project project-monitor-core: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plugin:2.0.2:upload are missing or invalid -> [Help 1]

My profile part POM:

<profiles>
    <profile>
      <id>cve-report</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
            <artifactId>wagon-maven-plugin</artifactId>
            <version>1.0</version>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>com.github.carlomorelli</groupId>
            <artifactId>licensescan-maven-plugin</artifactId>
            <version>2.1</version>
            <configuration>
              <printLicenses>true</printLicenses>
              <blacklistedLicenses>
                <license>GNU General Public License, v2.0</license>
                <license>GNU General Public License, v3.0</license>
                <license>regex:.*Affero.*</license> <!-- to enable use of wildcards, use string prefix 'regex:' -->
              </blacklistedLicenses>
              <failBuildOnBlacklisted>false</failBuildOnBlacklisted>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.owasp</groupId>
            <artifactId>dependency-check-maven</artifactId>
            <version>7.1.2</version>
            <configuration>
                <failBuildOnCVSS>11</failBuildOnCVSS>
                <formats>
                  <format>html</format>
                  <format>json</format>
                </formats>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>wagon-maven-plugin</artifactId>
            <version>1.0</version>
            <executions>
              <execution>
                <goals>
                    <goal>upload</goal>
                </goals>
                <configuration>
                    <fromDir>target/</fromDir>
                    <includes>**/*</includes>
                    <excludes>pom.xml</excludes>
                    <url>dav:https://myurl.com</url>
                    <toDir>cve/${project.groupId}/${project.artifactId}//${project.version}</toDir>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <build>
    <extensions>
      <extension>
          <groupId>org.apache.maven.wagon</groupId>
          <artifactId>wagon-webdav</artifactId>
          <version>1.0-beta-2</version>
      </extension>
    </extensions>
  </build>
  <pluginRepositories>
    <pluginRepository>
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
    </pluginRepository>
  </pluginRepositories>

I tried to delete my .m2/repository, change the version to 2.0.0/2.0.1 and it don't considerate my parameters and build is failing. If anyone has any idea what is causing the problem it would be very helpful.

Upvotes: -1

Views: 422

Answers (1)

Rems
Rems

Reputation: 26

I've solved my problem:

It was a problem related to child modules, in fact when I executed my command the upload program tried to run on child modules. To avoid this I had to add the tag:

<inherited>false</inherited>

Upvotes: 0

Related Questions