1
votes
I have an issue with a dependency in my pom.xml

<dependency>
    <groupId>com.risk.recoveries.common</groupId>
    <artifactId>disputemanager-client</artifactId>
    <version>1.7</version>
</dependency>

<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>com.risk.recoveries.common</groupId>
        <artifactId>common-parent</artifactId>
        <version>1.4-HELIX-4.0.0-SNAPSHOT</version>
        <relativePath>../../../buildconfig/superpom/pom.xml</relativePath>
    </parent>
  <groupId>com.risk.recoveries.common</groupId>
  <artifactId>disputemanager-client</artifactId>
  <version>1.7</version>
  <name>Dispute Manager Client</name>
  <description>Dispute Manager WSDL client - JAX-WS generated stub</description>
  <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.8.1</version>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <id>install</id>
                        <goals>
                            <goal>aggregate-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <linksource>true</linksource>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <wsdlDirectory>src/main/resources/wsdl</wsdlDirectory>
                            <extension>true</extension>
                            <wsdlFiles>
                                <wsdlFile>DisputeManager.wsdl</wsdlFile>
                            </wsdlFiles>
                            <!--wsdlLocation>wsdl/DisputeManager.wsdl</wsdlLocation-->
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <executions>
                    <execution>
                        <id>clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <configuration>
                            <filesets>
                                <fileset>
                                    <directory>target/generated/cxf</directory>
                                    <includes>
                                        <include>**/*.java</include>
                                    </includes>                                 
                                    <followSymlinks>true</followSymlinks>
                                </fileset>
                                <fileset>
                                    <directory>${basedir}/src/main/resources</directory>
                                    <includes>
                                        <include>**/*genlog</include>
                                    </includes>
                                </fileset>
                            </filesets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>jaxws/wsimport/java</directory>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.infra</groupId>
            <artifactId>infra-core</artifactId>
        </dependency> 
        <dependency>
            <groupId>com.kernel</groupId>
            <artifactId>uKernelCore</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jmock</groupId>
            <artifactId>jmock-legacy</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
        </dependency>
        <dependency>
            <groupId>com.domain.risk</groupId>
            <artifactId>disputemanager-v3-client</artifactId>
            <version>0.0.5-SNAPSHOT</version>
        </dependency>       
    </dependencies>
</project>

so here in the above pom file there is this parent tag((common-parent) which is not there in the nexus where my artifacts are downloading so i getting an error please find the error below, is there any way that i can exclude this parent tag(common-parent) from disputemanager-client artifact? Please help me with this.

Error:

[ERROR] Failed to execute goal on project riskactionmsgdDaemon: Could not resolve dependencies for project com.raptor.risk:riskactionmsgdDaemon:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at com.risk.recoveries.common:disputemanager-client:jar:1.7: Failed to read artifact descriptor for com.risk.recoveries.common:disputemanager-client:jar:1.7: Could not find artifact com.risk.recoveries.common:common-parent:pom:1.4-HELIX-4.0.0-SNAPSHOT in public (https://central.es.com/nexus/content/repositories/public/) -> [Help 1]

1
If you don't need a dependency is better to remove it from the pom.xml?Lesly Bernaola

1 Answers

1
votes

It is not possible to exclude a parent dependency.

Whoever wrote the pom.xml for disputemanager-client has badly abused the <relativePath> element. If a parent pom is not part of the project that references it then <relativePath> should not be specified at all.

First you need to verify that the parent pom.xml is not available anywhere in your Nexus repository. Be aware that SNAPSHOT artefacts (poms, jars, etc) are normally stored in a different repository than the released artefacts (those without -SNAPSHOT in the version). It could be that your ~/.m2/settings.xml file is not set up properly.

If you cannot find this file anywhere in Nexus then you should try to get a copy from a co-developer. Create buildconfig/superpom directories in a location three levels higher in your file system than your project (so that the relativePath resolves) and place the parent pom.xml (provided by the co-developer) there.

You will find it difficult to proceed without a copy of this file as it appears that the version information for many of the dependencies has been specified in it. Notice that many of the disputemanager-client dependencies have no <version>...</version> element? This is because these versions have been specified in that missing parent pom.xml (or even a parent of the parent).