Maven 站点插件在代理后面运行不佳
maven site plugin is not working well behind a proxy
我在我的项目中使用 maven (apache-maven-3.2.1) 和 maven-site-plugin。
在代理服务器后面mvn site
时,我收到以下警告/运行缓慢:
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Generating "Dependencies" report --- maven-project-info-reports-plugin:2.8:dependencies
[WARNING] The repository url 'http://download.oracle.com/maven' is invalid - Repository 'oracle.releases' will be blacklisted.
[WARNING] The repository url 'http://snapshots.repository.codehaus.org' is invalid - Repository 'codehaus-snapshots' will be black
listed.
[WARNING] The repository url 'http://repository.codehaus.org' is invalid - Repository 'codehaus' will be blacklisted.
[WARNING] The repository url 'http://download.java.net/maven/glassfish' is invalid - Repository 'glassfish-repository' will be bla
cklisted.
[WARNING] The repository url 'http://download.java.net/maven/2/' is invalid - Repository 'maven2-repository.dev.java.net' will be
blacklisted.
我构建成功,但我认为将有效存储库列入黑名单是一个问题...
我在代理后面 所以我在我的 Maven 全局设置中定义了一个代理 ($M2_HOME/conf/settings.xml
)。
对于某些插件,如 release-plugin
(请参见下面的示例)或 surefire-plugin
,我必须使用代理设置覆盖参数才能成功构建,但我找不到 arguments
(等效配置)用于 maven-site-plugin.
maven-release 代理背后的例子
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<arguments>${proxyString}</arguments>
</configuration>
</plugin>
(...)
<profile>
<id>proxy</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<proxyString>-Djava.net.useSystemProxies=true
-Dhttp.proxyHost=myProxy -Dhttp.proxyPort=3128
-Dhttps.proxyHost=myProxy -Dhttps.proxyPort=3128</proxyString>
</properties>
</profile>
我认为 maven 站点使用 maven-project-info-reports-plugin
但我不知道如何将代理参数传递给此插件(根据 the doc- 由 maven-site 内部配置)?
我看到了 old discussion on apache maven mailing list 但这对我没有帮助。
如何为 mvn site
设置代理?
日志列出了已弃用、移动或不存在的存储库,因此此警告是预期的。
由于这一步可能真的很慢,(通过这个src)有一种方法可以避免生成依赖位置:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
</plugins>
</pluginManagement>
我在我的项目中使用 maven (apache-maven-3.2.1) 和 maven-site-plugin。
在代理服务器后面mvn site
时,我收到以下警告/运行缓慢:
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Generating "Dependencies" report --- maven-project-info-reports-plugin:2.8:dependencies
[WARNING] The repository url 'http://download.oracle.com/maven' is invalid - Repository 'oracle.releases' will be blacklisted.
[WARNING] The repository url 'http://snapshots.repository.codehaus.org' is invalid - Repository 'codehaus-snapshots' will be black
listed.
[WARNING] The repository url 'http://repository.codehaus.org' is invalid - Repository 'codehaus' will be blacklisted.
[WARNING] The repository url 'http://download.java.net/maven/glassfish' is invalid - Repository 'glassfish-repository' will be bla
cklisted.
[WARNING] The repository url 'http://download.java.net/maven/2/' is invalid - Repository 'maven2-repository.dev.java.net' will be
blacklisted.
我构建成功,但我认为将有效存储库列入黑名单是一个问题...
我在代理后面 所以我在我的 Maven 全局设置中定义了一个代理 ($M2_HOME/conf/settings.xml
)。
对于某些插件,如 release-plugin
(请参见下面的示例)或 surefire-plugin
,我必须使用代理设置覆盖参数才能成功构建,但我找不到 arguments
(等效配置)用于 maven-site-plugin.
maven-release 代理背后的例子
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<arguments>${proxyString}</arguments>
</configuration>
</plugin>
(...)
<profile>
<id>proxy</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<proxyString>-Djava.net.useSystemProxies=true
-Dhttp.proxyHost=myProxy -Dhttp.proxyPort=3128
-Dhttps.proxyHost=myProxy -Dhttps.proxyPort=3128</proxyString>
</properties>
</profile>
我认为 maven 站点使用 maven-project-info-reports-plugin
但我不知道如何将代理参数传递给此插件(根据 the doc- 由 maven-site 内部配置)?
我看到了 old discussion on apache maven mailing list 但这对我没有帮助。
如何为 mvn site
设置代理?
日志列出了已弃用、移动或不存在的存储库,因此此警告是预期的。
由于这一步可能真的很慢,(通过这个src)有一种方法可以避免生成依赖位置:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
</configuration>
</plugin>
</plugins>
</pluginManagement>