我使用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
(cf下面的例子)或surefire-plugin
,我必须用代理设置覆盖参数以获得成功构建,但我没有找到maven-site-plugin的arguments
(等效配置)。
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
,但我不知道如何将代理参数传递给这个插件(这是-根据maven-site内部配置的文档)?
我在apache maven邮件列表上看到了一个旧的讨论,但这对我没有帮助。
如何设置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>