简体   繁体   中英

Reason: Not a v4.0.0 POM

I am getting build error when run with maven. below is the error snippet.

Caused by: java.io.FileNotFoundException: http://repo1.maven.org/maven2/com/day/jcr/vault/maven-vault-plugin/0.0.10/maven-vault-plugin-0.0.10.pom
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
        at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:115)
        ... 30 more
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol http
[INFO] Unable to find resource 'com.day.jcr.vault:maven-vault-plugin:pom:0.0.10' in repository central (http://repo1.maven.org/maven2)
[DEBUG] Trying repository adobe-public
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol http
[DEBUG] Checking for pre-existing User-Agent configuration.
[DEBUG] Adding User-Agent configuration.
[DEBUG] Connecting to repository: 'adobe-public' with url: 'http://repo.adobe.com/nexus/content/groups/public/'.
Downloading: http://repo.adobe.com/nexus/content/groups/public//com/day/jcr/vault/maven-vault-plugin/0.0.10/maven-vault-plugin-0.0.10.pom
[DEBUG] attempting to create parent directories for destination: maven-vault-plugin-0.0.10.pom.tmp
178b downloaded  (maven-vault-plugin-0.0.10.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '81ffbd1712afe8cdf138b570c0fc9934742c33c1'; remote = '<html>
<head><title>301' - RETRYING
Downloading: http://repo.adobe.com/nexus/content/groups/public//com/day/jcr/vault/maven-vault-plugin/0.0.10/maven-vault-plugin-0.0.10.pom
[DEBUG] attempting to create parent directories for destination: maven-vault-plugin-0.0.10.pom.tmp
178b downloaded  (maven-vault-plugin-0.0.10.pom)
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '81ffbd1712afe8cdf138b570c0fc9934742c33c1'; remote = '<html>
<head><title>301' - IGNORING
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol http
[DEBUG]   Artifact resolved
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: com.day.jcr.vault:maven-vault-plugin
POM Location: C:\Users\username\.m2\repository\com\day\jcr\vault\maven-vault-plugin\0.0.10\maven-vault-plugin-0.0.10.pom

Reason: Not a v4.0.0 POM. for project com.day.jcr.vault:maven-vault-plugin at C:\Users\username\.m2\repository\com\day\jcr\vault\maven-vault-plugi
n\0.0.10\maven-vault-plugin-0.0.10.pom


[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project for plugin 'com.day.jcr.vault:maven-vault-plugin': Not a v4.0.0 POM. f
or project com.day.jcr.vault:maven-vault-plugin at C:\Users\username\.m2\repository\com\day\jcr\vault\maven-vault-plugin\0.0.10\maven-vault-plugin
-0.0.10.pom
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.loadPluginFully(DefaultLifecycleExecutor.java:1599)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findArtifactTypeHandlersInPlugins(DefaultLifecycleExecutor.java:1468)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.findExtensions(DefaultLifecycleExecutor.java:222)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:178)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)

I have added maven repo then adobe repo. Intially build try to find vault plugin through maven repo, which cause error FNF, then tried adobe repo. Vault plugin is present on adobe repo, but its download only POM with 301 message.

Any thoughts.

pom snippet :

<repositories>
        <repository>
            <id>maven-central</id>
            <name>Maven2</name>
            <url>http://repo1.maven.org/maven2/</url>
        </repository>
        <repository>
            <id>adobe-public</id>
            <name>Adobe</name>
            <url>https://repo.adobe.com/nexus/content/groups/public/</url>
        </repository>
    </repositories>

After changing to https, fall back not happen to adobe. Below is the error :

    ... 27 more
Caused by: java.io.FileNotFoundException: http://repo1.maven.org/maven2/com/day/jcr/vault/maven-vault-plugin/0.0.10/maven-vault-plugin-0.0.10.jar
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:115)
    ... 27 more
[DEBUG] Using Wagon implementation lightweight from default mapping for protocol http
[INFO] Unable to find resource 'com.day.jcr.vault:maven-vault-plugin:maven-plugin:0.0.10' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository

You request an http URL and get back a 301 redirect to an https URL. Such redirects between schemes is not followed by default, because of security risks. When the POM is requested only the 301 redirect HTML page is retrieved which has 81ffbd1712afe8cdf138b570c0fc9934742c33c1 as SHA1 checksum. Then the POM URL + .sha1 is retrieved which should have the checksum of the POM in its first line and they are compared. Here again you onyl get the 301 redirect page, so 81ffbd1712afe8cdf138b570c0fc9934742c33c1 is compared against '<html>\\n<head><title>301' which of course does not match.

Configure the https URL instead for the Adobe repo directly and it should work just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM