1

When I try building the project. The build fails with the following message.

Could not calculate build plan: 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

I saw two similar questions and tried everything mentioned in the answers.

Things which I have tried.

  1. The settings.xml changes which includes proxy in ~.m2/repository/settings.xml -- cannot download anything from eclipse at work. Got the proxy settings from IE>Internet Options>Connections>Lan Setting. When I use command prompt to check whether its correct or not, telnet [host][port] nothing is received.

  2. Cleaning the Cache, m2 repository and updating the maven project, couldn't update it.

  3. Tried downloading the maven plugins manually and tried putting it in .m2>repository>apache>maven>plugins>[respective plugin folder] tried rebuilding again the same error.

Basically everything is blocked here at workplace.

The settings.xml file contents are:-

<settings>
    <proxies>
        <proxy>
            <id>proxy</id>
            <active>true</active>
            <protocol>HTTP</protocol>
            <host>proxy.asdf.com</host>
            <port>6050</port>
        </proxy>
    </proxies>
</settings>

The pom.xml file contents are:-

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.asdfasdf.asdfsd</groupId>
    <artifactId>Service</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>Service Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <properties>
        <springframework.version>4.2.0.RELEASE</springframework.version>
        <jackson.version>2.5.3</jackson.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>4.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>4.2.0/version> 
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.5.3</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>Service</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.5</version>
            </plugin>

        </plugins>
    </build>
</project> 

This is the error log. Error Log

Please help.

Vibhu Dadhichi
  • 1,099
  • 16
  • 21

1 Answers1

2

You wrote that your settings.xml is located in ~.m2/repository. I think that's wrong. It should be placed in ~/.m2.

Try to solve the problem step by step:

  1. Make sure maven is configured properly. Place settings.xml within ~/.m2. On command line, go into the project directory and invoke mvn clean package

  2. After first step, handle eclipse

Update

This answer provides information about communicating via SSL. It shows how to disable certificate checking:

  • -Dmaven.wagon.http.ssl.insecure=true - enable use of relaxed SSL check for user generated certificates.
  • -Dmaven.wagon.http.ssl.allowall=true - enable match of the server's X.509 certificate with hostname. If disabled, a browser like check will be used.
  • -Dmaven.wagon.http.ssl.ignore.validity.dates=true - ignore issues with certificate dates.
Community
  • 1
  • 1
JimHawkins
  • 4,843
  • 8
  • 35
  • 55
  • That doesn't matter I guess. I am changing it manually and pointing it to the desired folder. Window>Preferences>Maven>Setting you can set it manually where the settings.xml is. – Vibhu Dadhichi Jun 14 '16 at 09:56
  • What happens if you call `mvn clean package` from command line, within project directory? – JimHawkins Jun 14 '16 at 09:57
  • Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. I use eclipse. – Vibhu Dadhichi Jun 14 '16 at 09:59
  • Did that tried again. Didn't work. Have been stuck for quite some time now. – Vibhu Dadhichi Jun 14 '16 at 10:10