Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven build failure : could not transfer metadata

Tags:

java

maven

I'm trying to run maven clean install but i got these errors and warnings

[WARNING] Could not transfer metadata org.codehaus.mojo:cobertura-maven-plugin/maven-metadata.xml from/to maven-repository.dev.java.net (http://download.java.net/maven/1): Cannot access http://download.java.net/maven/1 with type legacy using the available connector factories: BasicRepositoryConnectorFactory
[WARNING] The POM for javax.transaction:jta:jar:1.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.1.7 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.springframework:spring-support:jar:2.0.8 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for javax.activation:activation:jar:1.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for javax.mail:mail:jar:1.4.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for net.sourceforge.jexcelapi:jxl:jar:2.6.10 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for net.sf.jasperreports:jasperreports:jar:3.7.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.codehaus.groovy:groovy-all:jar:1.6.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for com.lowagie:itext:jar:2.1.7 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for org.apache.poi:poi:jar:3.1-FINAL is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The POM for javax.servlet:jsp-api:jar:2.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
--
[WARNING] /D:/projet/perWeb/per/perTools/src/main/java/ma/archostechnology/swk/report/PDFReportingService.java: Some input files use unchecked or unsafe operations.
[WARNING] /D:/projet/perWeb/per/perTools/src/main/java/ma/archostechnology/swk/report/PDFReportingService.java: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings 
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] error reading D:\Fa\repository\javax\transaction\jta\1.1\jta-1.1.jar; error in opening zip file
[ERROR] error reading D:\Fa\repository\com\sun\xml\bind\jaxb-impl\2.1.7\jaxb-impl-2.1.7.jar; error in opening zip file
[ERROR] error reading D:\Faa\repository\org\springframework\spring-support\2.0.8\spring-support-2.0.8.jar; error in opening zip file
[ERROR] error reading    D:\Fa\repository\javax\activation\activation\1.1\activation-1.1.jar; error in opening zip file
[ERROR] error reading D:\Fa\repository\javax\mail\mail\1.4.1\mail-1.4.1.jar; error in opening zip file

here is my pom.xml

<?xml version="1.0"?>
<project>
    <parent>
        <artifactId>per</artifactId>
        <groupId>ma.archostechnology</groupId>
        <version>2.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>ma.archostechnology</groupId>
    <artifactId>perTools</artifactId>
    <name>Projet PER Tools</name>
    <url>http://maven.apache.org</url>

    <dependencies>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.1.7</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-support</artifactId>
            <version>2.0.8</version>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.1</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
            <version>2.6.10</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>3.7.4</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>1.6.0</version>
        </dependency>
        <dependency>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
            <version>2.1.7</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.1-FINAL</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>commons-vfs</groupId>
            <artifactId>commons-vfs</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>net.objectlab.kit</groupId>
            <artifactId>datecalc-common</artifactId>
            <version>1.2.0</version>
        </dependency>
        <dependency>
            <groupId>net.objectlab.kit</groupId>
            <artifactId>datecalc-jdk</artifactId>
            <version>1.2.0</version>
        </dependency>
        <dependency>
           <groupId>com.ibm.icu</groupId>
           <artifactId>icu4j</artifactId>
           <version>51.1</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>maven2-repository.dev.java.net</id>
            <name>Java.net Maven 2 Repository</name>
            <url>http://download.java.net/maven/2</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>maven-repository.dev.java.net</id>
            <name>Java.net Maven 1 Repository (legacy)</name>
            <url>http://download.java.net/maven/1</url>
            <layout>legacy</layout>
        </repository>
        <repository>
            <id>jfrog-plugins</id>
            <name>jfrog-plugins-dist</name>
            <url>
                http://www.jfrog.org/artifactory/plugins-releases@repo
            </url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>localrepository</id>
            <name>localrepository</name>
            <url>D:\FatimaZahra\repository</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>maven2-repository.dev.java.net</id>
            <url>http://download.java.net/maven/2</url>
        </pluginRepository>
        <pluginRepository>
            <id>maven-repository.dev.java.net</id>
            <url>http://download.java.net/maven/1</url>
            <layout>legacy</layout>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <defaultGoal>install</defaultGoal>
        <plugins>
            <plugin>
                <inherited>true</inherited>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>


</project>

When i run the mvn -X compile i got this

[DEBUG] Resolving plugin version for org.codehaus.mojo:cobertura-maven-plugin
[DEBUG] Could not find metadata org.codehaus.mojo:cobertura-maven-plugin/maven-metadata.xml in local (D:\FatimaZahra\repository)
[DEBUG] Failure to find org.codehaus.mojo:cobertura-maven-plugin/maven-metadata.xml in http://download.java.net/maven/2 was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.dev.java.net has elapsed or updates are forced
[DEBUG] Skipped remote request for org.codehaus.mojo:cobertura-maven-plugin/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Writing tracking file D:\FatimaZahra\repository\org\codehaus\mojo\cobertura-maven-plugin\resolver-status.properties
[WARNING] Could not transfer metadata org.codehaus.mojo:cobertura-maven-plugin/maven-metadata.xml from/to maven-repository.dev.java.net (http://download.java.net/maven/1): Cannot access http://download.java.net/maven/1 with type legacy using the available connector factories: BasicRepositoryConnectorFactory
org.eclipse.aether.transfer.MetadataTransferException: Could not transfer metadata org.codehaus.mojo:cobertura-maven-plugin/maven-metadata.xml from/to maven-repository.dev.java.net (http://download.java.net/maven/1): Cannot access http://download.java.net/maven/1 with type legacy using the available connector factories: BasicRepositoryConnectorFactory
    at org.eclipse.aether.internal.impl.DefaultMetadataResolver$ResolveTask.run(DefaultMetadataResolver.java:632)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
    at org.eclipse.aether.internal.impl.DefaultMetadataResolver$1.execute(DefaultMetadataResolver.java:527)
    at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolve(DefaultMetadataResolver.java:382)
    at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolveMetadata(DefaultMetadataResolver.java:205)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveMetadata(DefaultRepositorySystem.java:309)
    at org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver.resolveFromRepository(DefaultPluginVersionResolver.java:133)
    at org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver.resolve(DefaultPluginVersionResolver.java:96)
    at org.apache.maven.lifecycle.internal.LifecyclePluginResolver.resolveMissingPluginVersions(LifecyclePluginResolver.java:89)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:125)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:145)
    at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:109)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: Cannot access http://download.java.net/maven/1 with type legacy using the available connector factories: BasicRepositoryConnectorFactory
    at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:174)
    at org.eclipse.aether.internal.impl.DefaultMetadataResolver$ResolveTask.run(DefaultMetadataResolver.java:603)
    ... 29 more
Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: Cannot access http://download.java.net/maven/1 with type legacy using the available layout factories: Maven2RepositoryLayoutFactory
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.<init>(BasicRepositoryConnector.java:111)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory.newInstance(BasicRepositoryConnectorFactory.java:180)
    at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:113)
    ... 30 more
Caused by: org.eclipse.aether.transfer.NoRepositoryLayoutException: Cannot access http://download.java.net/maven/1 with type legacy using the available layout factories: Maven2RepositoryLayoutFactory
    at org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider.newRepositoryLayout(DefaultRepositoryLayoutProvider.java:142)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.<init>(BasicRepositoryConnector.java:107)
    ... 32 more
Caused by: org.eclipse.aether.transfer.NoRepositoryLayoutException: Unsupported repository layout legacy
    at org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory.newInstance(Maven2RepositoryLayoutFactory.java:64)
    at org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider.newRepositoryLayout(DefaultRepositoryLayoutProvider.java:111)
    ... 33 more

I've already tried to delete the repository and i'm not using any proxy. Is there anything i'm missing? Could you help me please

like image 573
Chaymae Avatar asked Mar 14 '17 09:03

Chaymae


2 Answers

In my case it was a false certificate inside the JDK i used.

like image 190
Michael Goppelt Avatar answered Sep 19 '22 11:09

Michael Goppelt


You have wrong URLs for the repos. Please check this page and choose the right one.

like image 45
Egor Zhuk Avatar answered Sep 20 '22 11:09

Egor Zhuk