Maven 搜索 site.xml 缺少的英语语言环境

标签 maven maven-3 maven-site-plugin maven-javadoc-plugin

在使用 maven 构建项目期间,我在更新其父项目的版本后遇到了生成 javadoc 的问题。

2016-08-18 16:06:44.559 [INFO] <<< maven-javadoc-plugin:2.10.3:aggregate < generate-sources @ org.eclipse.scout.rt <<<
2016-08-18 16:06:44.560 [DEBUG] building maven31 dependency graph for org.eclipse.scout.rt:org.eclipse.scout.rt:pom:6.0.0-SNAPSHOT with Maven31DependencyGraphBuilder
2016-08-18 16:06:44.560 [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=1, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=0, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=0, DefaultDependencyCollector.collectTime=0, DefaultDependencyCollector.transformTime=0}
2016-08-18 16:06:44.561 [DEBUG] org.eclipse.scout.rt:org.eclipse.scout.rt:pom:6.0.0-SNAPSHOT
2016-08-18 16:06:44.636 [DEBUG]  canGenerateReport = true for project MavenProject: org.eclipse.scout.rt:org.eclipse.scout.rt:6.0.0-SNAPSHOT @ /home/<REDACTED>/workspace/org.eclipse.scout.rt.branch-6.0_nightly-sitedocs/org.eclipse.scout.rt/pom.xml
2016-08-18 16:06:44.662 [DEBUG] Computing decoration model of org.eclipse.scout.rt:org.eclipse.scout.rt:pom:6.0.0-SNAPSHOT for locale en
2016-08-18 16:06:44.662 [DEBUG] No site descriptor found for org.eclipse.scout.rt:org.eclipse.scout.rt:pom:6.0.0-SNAPSHOT
2016-08-18 16:06:44.663 [DEBUG] Looking for site descriptor of level 1 parent project: org.eclipse.scout:maven_rt_plugin_config-master:pom:2.0.7
2016-08-18 16:06:44.665 [DEBUG] Using transporter WagonTransporter with priority -1.0 for <REDACTED>
2016-08-18 16:06:44.666 [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for <REDACTED>
2016-08-18 16:06:44.666 [INFO] Downloading: <REDACTED>/org/eclipse/scout/maven_rt_plugin_config-master/2.0.7/maven_rt_plugin_config-master-2.0.7-site_en.xml
2016-08-18 16:06:45.289 [DEBUG] Writing tracking file /home/<REDACTED>/workspace/org.eclipse.scout.rt.branch-6.0_nightly-sitedocs/.repository/org/eclipse/scout/maven_rt_plugin_config-master/2.0.7/maven_rt_plugin_config-master-2.0.7-site_en.xml.lastUpdated
2016-08-18 16:06:45.597 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.5.1:site (default-cli) on project org.eclipse.scout.rt: SiteToolException: The site descriptor cannot be resolved from the repository: ArtifactResolutionException: Unable to locate site descriptor: Could not transfer artifact org.eclipse.scout:maven_rt_plugin_config-master:xml:site_en:2.0.7 from/to AAA.libs.release (<REDACTED>): Access denied to: <REDACTED>/org/eclipse/scout/maven_rt_plugin_config-master/2.0.7/maven_rt_plugin_config-master-2.0.7-site_en.xml , ReasonPhrase:Forbidden.
2016-08-18 16:06:45.598 [ERROR] org.eclipse.scout:maven_rt_plugin_config-master:xml:2.0.7
2016-08-18 16:06:45.598 [ERROR] 
2016-08-18 16:06:45.598 [ERROR] from the specified remote repositories:
2016-08-18 16:06:45.598 [ERROR] AAA.libs.release (<REDACTED>, releases=true, snapshots=false),
2016-08-18 16:06:45.599 [ERROR] AAA.libs.snapshots (<REDACTED>, releases=false, snapshots=true),
2016-08-18 16:06:45.599 [ERROR] eclipse.release (https://repo.eclipse.org/content/groups/releases/, releases=true, snapshots=false),
2016-08-18 16:06:45.599 [ERROR] eclipse.snapshot (https://repo.eclipse.org/content/groups/snapshots/, releases=true, snapshots=true),
2016-08-18 16:06:45.599 [ERROR] remote-repos (<REDACTED>, releases=true, snapshots=false)

如您所见,它会尝试下载 maven_rt_plugin_config-master-2.0.7-site_en.xml,但实际上并不存在。但是确实存在这样一个没有 _en 后缀的 xml...

据我所知,我没有指定任何语言环境,并且与站点或 javadoc 生成相关的父项目中似乎没有任何更改。

为什么 Maven 不回退到默认语言环境?

最佳答案

如果这可能有助于其他人试图弄清楚为什么 maven 从父项目中搜索 site.xmlsite_en.xml 并在希望只是使用默认设置:

在使用 SpringBoot 时遇到了类似的问题。 mvn clean site 尝试从中央 (https://repo.maven.apache.org/maven2) 传输 spring-boot-starter-parent:xml:site_en:1.4.0.RELEASE 失败:

repo.maven.apache.org:443 repo.maven.apache.org/x.x.x.x failed: Connection timed out: connect

当项目配置为使用公司存储库时会发生这种情况,但在使用 maven central direct 时不会发生这种情况。似乎在公司存储库到位后,该请求被代理为安全请求。对中央的安全请求因“超时”而失败,构建失败。如果请求不安全,则将从中央返回“未找到”,并且 maven 将继续使用默认设置。所以在这种情况下,404 会很好(根据需要继续使用默认值)其他错误代码不好(构建失败)。

有几种方法可以解决这个问题:

  • 将文件安装到本地存储库(hack)
  • 公司 repo 服务器上的配置更改(可能是真正的修复,与接受的答案中描述的相同)
  • 在maven settings.xml文件中配置代理设置

这是 settings.xml 代理配置的示例:

<proxy>
    <active>true</active>
    <protocol>http</protocol>
    <host>my.corporate.proxy</host>
    <port>myPort</port>
    <nonProxyHosts>*.my.corporate.domain|*.my.subsidiary.domain</nonProxyHosts>
</proxy>

关于Maven 搜索 site.xml 缺少的英语语言环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39033095/

相关文章:

maven-2 - 站点 apt 文件中的 Maven 属性

java - 使用 Maven Plugin 参数值作为另一个参数的默认值

java - 将 WAR 打包到 JBoss SAR 中

java - Citrus Framework-SUT与其他服务进行通信时出现问题

java - 使用 Maven 在远程服务器上部署 Java 应用程序

java - 无法加载 mojo 'test' - org.apache.maven.plugins :maven-surefire-plugin:3. 0.0-M1:test

java - 运行所有 Maven 测试时无法控制 log4j

java - Maven 站点命令失败

maven - 如何修复多模块项目的 Maven 站点中损坏的子模块链接?

java - 在我的 Spring 上下文文件中找不到 "ehcache: annotation-driven"定义