0

I'm getting the following...

[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: 3 problems were encountered while building the effective model for org.apache.maven.plugins:maven-resources-plugin:2.6

[ERROR] [ERROR] Invalid packaging for parent POM org.apache.maven.plugins:maven-resources-plugin:2.6, must be "pom" but is "maven-plugin" @ 

[ERROR] [ERROR] Invalid packaging for parent POM org.apache.maven.plugins:maven-resources-plugin:2.6, must be "pom" but is "maven-plugin" @ 

[ERROR] [FATAL] The parents form a cycle: org.apache.maven.plugins:maven-resources-plugin:2.6 -> org.apache.maven.plugins:maven-resources-plugin:2.6 @

Here is the POM

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
     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>
<groupId>Automation</groupId>
<artifactId>BCBDTests</artifactId>
<version>LOCALBUILD</version>
<name>BCBDTests</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
    <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
    <maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
    <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
</properties>

<repositories>
    <repository>
        <id>test-automation-mvn</id>
        <name>test-automation-mvn</name>
        <url>https://my.local.artifactory.com/artifactory/test-automation-mvn</url>
    </repository>
</repositories>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-plugin.version}</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <compilerArgs>
                    <arg>-parameters</arg>
                </compilerArgs>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven-surefire-plugin.version}</version>
            <configuration>
                <skipTests>true</skipTests>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>${maven-dependency-plugin.version}</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <outputDirectory>${project.build.directory}/lib</outputDirectory>
                <overWriteReleases>false</overWriteReleases>
                <overWriteSnapshots>false</overWriteSnapshots>
                <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
        </plugin>
    </plugins>
</build>

And here is the resultant POM that I find in my .m2 directory after attempting to build:

<?xml version="1.0" encoding="UTF-8"?><!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
--><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>
    <artifactId>maven-resources-plugin</artifactId>
    <groupId>org.apache.maven.plugins</groupId>
    <version>2.6</version>
    <relativePath>../maven-plugins/pom.xml</relativePath>
  </parent>

  <artifactId>maven-resources-plugin</artifactId>
  <version>2.6</version>
  <packaging>maven-plugin</packaging>

  <name>Maven Resources Plugin</name>
  <description>
    The Resources Plugin handles the copying of project resources to the output
    directory. There are two different kinds of resources: main resources and test resources. The
    difference is that the main resources are the resources associated to the main
    source code while the test resources are associated to the test source code.
    Thus, this allows the separation of resources for the main source code and its
    unit tests.
  </description>
  <inceptionYear>2001</inceptionYear>

  <prerequisites>
    <maven>${mavenVersion}</maven>
  </prerequisites>

  <scm>
    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-resources-plugin- 2.6</connection>
    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-resources- plugin-2.6</developerConnection>
    <url>http://svn.apache.org/viewvc/maven/plugins/tags/maven-resources-plugin-2.6</url>
  </scm>
  <issueManagement>
    <system>JIRA</system>
    <url>http://jira.codehaus.org/browse/MRESOURCES</url>
  </issueManagement>

  <properties>
    <mavenFilteringVersion>1.1</mavenFilteringVersion>
    <mavenVersion>2.0.6</mavenVersion>
    <mavenPluginPluginVersion>3.1</mavenPluginPluginVersion>
  </properties>

  <contributors>
    <contributor>
      <name>Graham Leggett</name>
    </contributor>
  </contributors>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-settings</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>${mavenVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-monitor</artifactId>
      <version>${mavenVersion}</version>
   </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-container-default</artifactId>
      <version>1.0-alpha-9-stable-1</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${mavenPluginPluginVersion}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>2.0.5</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-filtering</artifactId>
      <version>${mavenFilteringVersion}</version>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-interpolation</artifactId>
      <version>1.13</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <version>1.0-beta-1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>1.4</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${mavenPluginPluginVersion}</version>
          <configuration>
            <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
          </configuration>
          <executions>
            <execution>
              <id>mojo-descriptor</id>
              <goals>
                <goal>descriptor</goal>
              </goals>
            </execution>
            <execution>
              <id>help-goal</id>
              <goals>
                <goal>helpmojo</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <reporting>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-plugin-plugin</artifactId>
         <version>${mavenPluginPluginVersion}</version>
       </plugin>
     </plugins>
   </reporting>

  <profiles>
    <profile>
      <id>run-its</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-invoker-plugin</artifactId>
              <version>1.7</version>
              <configuration>
                <debug>true</debug>
                <postBuildHookScript>verify</postBuildHookScript>
                <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                <goals>
                  <goal>clean</goal>
                  <goal>process-test-resources</goal>
                </goals>
                <settingsFile>src/it/settings.xml</settingsFile>
                <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                <properties>
                  <execProps>fromExecProps</execProps>
                </properties>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>test-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>test-descriptor</goal>
                </goals>
              </execution>
            </executions>
          </plugin>          
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
Dave Newton
  • 158,873
  • 26
  • 254
  • 302
GregMa
  • 740
  • 2
  • 10
  • 25
  • Have you removed your local repository and tried again? – J Fabian Meier May 13 '21 at 15:28
  • I have, may times. If I change the POM locally in my .m2 removing the parent section and moving the down to just above the it then works properly. Unfortunately, that is only a temporary solution. – GregMa May 14 '21 at 13:15
  • The POM you show is not the original POM of the maven resources plugin. The original POM has the following parent definition ` maven-plugins org.apache.maven.plugins 23 ../maven-plugins/pom.xml ` – J Fabian Meier May 14 '21 at 14:04
  • unfortunately, I did not put that POM there. It was placed by something else when doing a make – GregMa May 17 '21 at 20:58
  • I would try to redownload this stuff from MavenCentral. – J Fabian Meier May 18 '21 at 06:26
  • Tried that many times. – GregMa May 28 '21 at 14:53
  • So, what happens? The file is different on MavenCentral. Is it overridden after downloading it by something else? Does the download fail? – J Fabian Meier May 28 '21 at 15:14
  • We can't use MavenCentral, all SSL stuff is blocked, thus we have to use an internal repository. I have redownloaded everything from MavenCentral and updated our local repository with the re-downloaded jar files and poms several times. Each time, I get the exact same thing. – GregMa May 28 '21 at 15:16
  • So at which exact stage does the wrong POM file come in? Is it already in your internal repository and you copy it from there? What exactly is your process to download the POMs? – J Fabian Meier May 28 '21 at 15:28
  • To be honest, I have no idea where it's coming from. I can delete the local repository, do a maven-Verify which grabs all the dependencies and it shows up. – GregMa Jun 04 '21 at 14:05
  • Then check all the repositories in your `settings.xml` and your `pom.xml` and see whether they contain the wrong POM. – J Fabian Meier Jun 04 '21 at 14:39
  • I gave the POM in the original post, nothing else that has to do with maven anywhere else in the rest of the POM. Settings.xml only contains the redirection to our internal repository overriding maven central. – GregMa Jun 07 '21 at 13:29
  • So does the internal repository contain the wrong POM? – J Fabian Meier Jun 07 '21 at 13:32
  • Not sure how to add code in a comment, so added the POM in our repository to the original post. Well, I can't add it to the original post. I'm stuck in the... This looks like code, add it as code. When I do that.... You have more code than details, add more details. I've added 5 lines as just random stuff and it still says I have more code than details. Let me try to just paste it here. org.apache.maven.plugins maven-resources-plugin 2.6 pom – GregMa Jun 07 '21 at 13:48

0 Answers0