Search code examples
javamavenapache-axis

Dependency on dependency leading to SNAPSHOT dependency in Maven


I am trying to use Maven for a Java Application I am writing and am trying to use Java2WSDL with

    <plugin>
      <groupId>org.apache.axis2.maven2</groupId>
      <artifactId>axis2-java2wsdl-maven-plugin</artifactId>
      <version>${java2wsdl.version}</version>
      <configuration>
        <className>com.barclays.hypercube.marketdata.Model.PointSeriesClient</className>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>java2wsdl</goal>
          </goals>
        </execution>
      </executions>
    </plugin>

It seems that there is a dependency on

org.apache.ws.commons.axiom:axiom-api:jar:SNAPSHOT

Unsurprisingly this is not available from my Maven repository.

Is there any way to override this? Perhapos with a value in my settings.xml file.


Solution

  • You can exclude that unwanted jar from this maven. But first make sure you do not need this jar. Like here

    <project>
      ...
      <dependencies>
        <dependency>
          <groupId>sample.ProjectA</groupId>
          <artifactId>Project-A</artifactId>
          <version>1.0</version>
          <scope>compile</scope>
          <exclusions>
            <exclusion>  <!-- declare the exclusion here -->
              <groupId>sample.ProjectB</groupId>
              <artifactId>Project-B</artifactId>
            </exclusion>
          </exclusions> 
        </dependency>
      </dependencies>
    </project>