为什么我收到Maven错误:"无法确定资源X是否存在于http://maven.glassfish.org/content/groups/glassfish&#34 ;?

时间:2014-10-01 15:09:17

标签: java maven glassfish

每当我们在Maven中执行site目标时,我们会在控制台日志中获得一长串与依赖项相关的错误。这些错误似乎是在构建的依赖关系报告创建过程中生成的。在针对http://maven.glassfish.org/content/groups/glassfish存储库检查资源时,似乎生成了所有错误。 (那里也有一个奇怪的JavaFX错误,但我们现在不用担心这个错误) 构建确实成功完成。

10:21:52 [INFO] Generating "Dependencies" report         --- maven-project-info-reports-plugin:2.7:dependencies
10:22:07 [ERROR] Artifact: com.oracle:javafx:jar:2.2.25 has no file.
10:22:09 [WARNING] The repository url 'http://repository.springsource.com/maven/bundles/external' is invalid - Repository 'spring-external' will be blacklisted.
10:22:10 [WARNING] The repository url 'http://download.oracle.com/maven' is invalid - Repository 'oracleReleases' will be blacklisted.
10:22:12 [ERROR] Unable to determine if resource com.fasterxml.jackson.core:jackson-databind:jar:2.4.1.3:compile exists in http://maven.glassfish.org/content/groups/glassfish
10:22:12 [ERROR] Unable to determine if resource com.google.api-client:google-api-client:jar:1.19.0:compile exists in http://maven.glassfish.org/content/groups/glassfish
10:22:13 [ERROR] Unable to determine if resource com.google.apis:google-api-services-calendar:jar:v3-rev88-1.19.0:compile exists in http://maven.glassfish.org/content/groups/glassfish
10:22:13 [ERROR] Unable to determine if resource com.google.guava:guava-jdk5:jar:13.0:compile exists in http://maven.glassfish.org/content/groups/glassfish
...

我做了一些研究,似乎列出的存储库URL是正确的。我想知道它是否可能是我们的Dependencies报告插件中的错误?不太确定,此时欢迎提出建议或猜测

修改 发布以下错误之一的详细控制台输出:

[ERROR] Unable to determine if resource com.google.guava:guava-jdk5:jar:13.0:compile exists in http://maven.glassfish.org/content/groups/glassfish
org.apache.maven.wagon.TransferFailedException: Failed to look for file: http://maven.glassfish.org/content/groups/glassfish//com/google/guava/guava-jdk5/13.0/guava-jdk5-13.0.jar. Return code is: 301
    at org.apache.maven.wagon.providers.http.LightweightHttpWagon.resourceExists(LightweightHttpWagon.java:351)
    at org.apache.maven.report.projectinfo.dependencies.RepositoryUtils.dependencyExistsInRepo(RepositoryUtils.java:228)
    at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.printArtifactsLocations(DependenciesRenderer.java:1311)
    at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyRepositoryLocations(DependenciesRenderer.java:756)
    at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody(DependenciesRenderer.java:269)
    at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:79)
    at org.apache.maven.report.projectinfo.DependenciesReport.executeReport(DependenciesReport.java:186)
    at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:190)
    at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:224)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:311)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:129)
    at org.apache.maven.plugins.site.render.SiteMojo.renderLocale(SiteMojo.java:182)
    at org.apache.maven.plugins.site.render.SiteMojo.execute(SiteMojo.java:141)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    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)
http://maven.glassfish.org/content/groups/glassfish - Session: Disconnecting  
http://maven.glassfish.org/content/groups/glassfish - Session: Disconnected
http://download.java.net/maven/2 - Session: Opened  
http://download.java.net/maven/2 - Session: Disconnecting  
http://download.java.net/maven/2 - Session: Disconnected
http://download.java.net/maven/1 - Session: Opened  
http://download.java.net/maven/1 - Session: Disconnecting  
http://download.java.net/maven/1 - Session: Disconnected
https://maven.java.net/content/groups/public - Session: Opened  
https://maven.java.net/content/groups/public - Session: Disconnecting  
https://maven.java.net/content/groups/public - Session: Disconnected
http://repo.maven.apache.org/maven2 - Session: Opened  
http://repo.maven.apache.org/maven2 - Session: Disconnecting  
http://repo.maven.apache.org/maven2 - Session: Disconnected
http://maven.glassfish.org/content/groups/glassfish - Session: Opened  

4 个答案:

答案 0 :(得分:30)

您只需在<dependency.locations.enabled>false</dependency.locations.enabled>的“属性”部分添加pom.xml作为下一步,即可停用相关性位置检查:

<properties>
    ...
    <dependency.locations.enabled>false</dependency.locations.enabled>
</properties>

默认值为true,有关详细信息,请参阅参数dependencyLocationsEnabled

答案 1 :(得分:8)

如果某些回购信息似乎已损坏,您可以使用
停用此检查 <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#FFFFFF"/> <stroke android:width="3dip" android:color="#B1BCBE" /> <corners android:radius="10dip"/> <padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" /> </shape>

检查此链接 https://whatiscomingtomyhead.wordpress.com/2011/04/20/if-your-maven-site-build-is-too-slow/

答案 2 :(得分:0)

如果您检查http://maven.glassfish.org/content/groups/glassfishhttp://maven.glassfish.org/content/groups/glassfish//com/google/guava/guava-jdk5/13.0/guava-jdk5-13.0.jar(来自详细日志),您会发现内容确实没有内容(404)。

pom.xml中的存储库设置可能有问题。您可以尝试在其他存储库之前添加repo1:

<repositories>
    <repository>
        <id>maven-central</id>
        <url>http://repo1.maven.org/maven2</url>
    </repository>
    ...
</repositories>

因为大多数东西都在maven中央仓库中,所以你可以从pom.xml中删除所有的存储库(Spring repo除外,如果你真的使用Spring的话)。

另见:

答案 3 :(得分:0)

这个有问题的功能似乎在更高版本的 Maven 站点插件中被删除了。使用最新版本:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.9.1</version>
      </plugin>

您可能还想:

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.1.2</version>
      </plugin>
      <!-- possibly other plugins -->
    </plugins>
  </reporting>