Maven插件不使用eclipse的代理设置

我正在使用基于eclipse 3.7的springource工具套件2.7.2。 现在maven插件已经出来了,这个eclipse很棒,而且这个问题甚至发生在以前的eclipse版本中。

所以这里是我的问题:我已经在我的settings.xml文件中设置代理信息,并在命令行maven工作得很好。 我也在eclipseconfiguration中设置了相同的代理详细信息,我知道这是正确的,以及更新与它一起工作,而不是没有。 当然,我的eclipse中的maven插件被设置为使用正确的settings.xml文件。

但是Eclipse中的maven并不使用来自这两个地方的代理设置,每次更改pom文件都非常烦人。 有没有人有这个问题的解决scheme?

的settings.xml

这是我的settings.xml文件:

<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <profiles> <profile> <id>general</id> <repositories> <repository> <snapshots><enabled>false</enabled></snapshots> <id>ibiblio</id> <name>Maven ibiblio</name> <url>http://www.ibiblio.org/maven2</url> </repository> <repository> <snapshots><enabled>true</enabled></snapshots> <id>ibiblio2</id> <name>Maven ibiblio2</name> <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url> </repository> <repository> <snapshots><enabled>true</enabled></snapshots> <id>maven</id> <name>Maven sunsite</name> <url>http://repo1.maven.org/maven2/</url> </repository> <repository> <snapshots><enabled>true</enabled></snapshots> <id>jboss</id> <name>Maven jboss</name> <url>http://repository.jboss.org/maven2/</url> </repository> </repositories> </profile> </profiles> <activeProfiles> <activeProfile>general</activeProfile> </activeProfiles> <proxies> <proxy> <id>proxy</id> <active>true</active> <protocol>http</protocol> <host>myproxyserver</host> <port>80</port> <username>myusername</username> <password>mypassword</password> </proxy> </proxies> </settings> 

Maven插件使用可以设置configuration的设置文件。 它的path在Eclipse的Window|Preferences|Maven|User Settings可用。 如果该文件不存在,请创build它并将其放在如下所示的内容中:

 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository/> <interactiveMode/> <usePluginRegistry/> <offline/> <pluginGroups/> <servers/> <mirrors/> <proxies> <proxy> <id>myproxy</id> <active>true</active> <protocol>http</protocol> <host>192.168.1.100</host> <port>6666</port> <username></username> <password></password> <nonProxyHosts>localhost|127.0.0.1</nonProxyHosts> </proxy> </proxies> <profiles/> <activeProfiles/> </settings> 

编辑文件后,只需点击“ Update Settingsbutton即可完成。 我刚刚做到了,它的工作:)

 <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"> <proxies> <proxy> <active>true</active> <protocol>http</protocol> <host>proxy.somewhere.com</host> <port>8080</port> <username>proxyuser</username> <password>somepassword</password> <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts> </proxy> </proxies> </settings> 

窗口>首选项> Maven>用户设置

在这里输入图像说明

Eclipse默认不知道你的外部maven安装,并使用embedded式的。 因此,为了让Eclipse使用你的全局设置,你需要在Settings -> Maven -> Installations中进行Settings -> Maven -> Installations