Macos MAVEN_选择在运行mvn帮助时未反映的代理设置:有效设置-如何阻止mvn使用系统定义的SOCKS代理?

Macos MAVEN_选择在运行mvn帮助时未反映的代理设置:有效设置-如何阻止mvn使用系统定义的SOCKS代理?,macos,maven,proxy,maven-surefire-plugin,socks,Macos,Maven,Proxy,Maven Surefire Plugin,Socks,我试图阻止maven 3.3.9(在Mac OS 10.12.3和Java 1.8.0_121上运行)使用系统首选项中定义的SOCKS代理 我已从我的settings.xml中删除了所有proxy元素 在我的.bash\u配置文件中,我设置了以下内容: export MAVEN_OPTS=" -Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=80 \ -Dhttps.proxyHost=proxy.example.com -Dhttps.pr

我试图阻止maven 3.3.9(在Mac OS 10.12.3和Java 1.8.0_121上运行)使用系统首选项中定义的SOCKS代理

我已从我的
settings.xml
中删除了所有
proxy
元素

在我的
.bash\u配置文件中,我设置了以下内容:

export MAVEN_OPTS="
-Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=80 \
-Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=80 \
-Dhttp.nonProxyHosts=localhost|foo.example.com|*.bar.example.com|*.baz.example.com \
-Dhttps.nonProxyHosts=localhost|foo.example.com|*.bar.example.com|*.baz.example.com \
-DsocksProxyHost -DsocksProxyPort"
<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/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
  <localRepository xmlns="http://maven.apache.org/SETTINGS/1.1.0">/java/.m2/repository</localRepository>
  <servers xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <!-- ... -->
  </servers>
  <mirrors xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <mirror>
      <mirrorOf>*</mirrorOf>
      <url>http://nexus.example.com:nnnn/...</url>
      <id>nexus</id>
    </mirror>
  </mirrors>
  <profiles xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <profile>
      <repositories>
        <repository>
          <releases />
          <snapshots />
          <id>central</id>
          <url>http://central</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <releases />
          <snapshots />
          <id>central</id>
          <url>http://central</url>
        </pluginRepository>
      </pluginRepositories>
      <id>nexus</id>
    </profile>
  </profiles>
  <activeProfiles xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
  <pluginGroups xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <pluginGroup>org.apache.maven.plugins</pluginGroup>
    <pluginGroup>org.codehaus.mojo</pluginGroup>
  </pluginGroups>
</settings>
当我运行mvn帮助:有效设置时,我得到以下信息:

export MAVEN_OPTS="
-Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=80 \
-Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=80 \
-Dhttp.nonProxyHosts=localhost|foo.example.com|*.bar.example.com|*.baz.example.com \
-Dhttps.nonProxyHosts=localhost|foo.example.com|*.bar.example.com|*.baz.example.com \
-DsocksProxyHost -DsocksProxyPort"
<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/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
  <localRepository xmlns="http://maven.apache.org/SETTINGS/1.1.0">/java/.m2/repository</localRepository>
  <servers xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <!-- ... -->
  </servers>
  <mirrors xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <mirror>
      <mirrorOf>*</mirrorOf>
      <url>http://nexus.example.com:nnnn/...</url>
      <id>nexus</id>
    </mirror>
  </mirrors>
  <profiles xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <profile>
      <repositories>
        <repository>
          <releases />
          <snapshots />
          <id>central</id>
          <url>http://central</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <releases />
          <snapshots />
          <id>central</id>
          <url>http://central</url>
        </pluginRepository>
      </pluginRepositories>
      <id>nexus</id>
    </profile>
  </profiles>
  <activeProfiles xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
  <pluginGroups xmlns="http://maven.apache.org/SETTINGS/1.1.0">
    <pluginGroup>org.apache.maven.plugins</pluginGroup>
    <pluginGroup>org.codehaus.mojo</pluginGroup>
  </pluginGroups>
</settings>
知道我需要做什么来阻止maven获取系统设置吗

更新

我刚检查过,终端显示正在执行以下操作:

java '-Dhttp.proxyHost=proxy.example.com’ '-Dhttp.proxyPort=80' '-Dhttps.proxyHost=proxy.example.com’ '-Dhttps.proxyPort=80' '-Dhttp.nonProxyHosts=localhost|…’ '-Dhttps.nonProxyHosts=localhost|…’ -DsocksProxyHost -DsocksProxyPort -classpath /.../apache-maven/boot/plexus-classworlds-2.5.2.jar '-Dclassworlds.conf=/.../apache-maven/bin/m2.conf' '-Dmaven.home=/.../apache-maven' '-Dmaven.multiModuleProjectDirectory=/.../foo/trunk/bar’ org.codehaus.plexus.classworlds.launcher.Launcher clean install

...

java '-javaagent:/.../.m2/repository/org/jacoco/org.jacoco.agent/0.7.8/org.jacoco.agent-0.7.8-runtime.jar=destfile=/.../foo/trunk/bar/baz/target/jacoco.exec' -jar /.../foo/trunk/bar/baz/target/surefire/surefirebooternnnnnnn.jar /.../foo/trunk/bar/baz/target/surefire/surefirennnnnnntmp /.../foo/trunk/bar/baz/target/surefire/surefire_nnnnntmp
这使我认为设置确实由父
mvn
进程获取,但它们不会传递给子进程(即
surefire

顺便说一句,设置
export JAVA_TOOL_OPTIONS=“-DsocksProxyHost-DsocksProxyPort”
会强制它们进入子进程,并且我的构建会通过(而设置
export JAVA_OPTS=“-DsocksProxyHost-DsocksProxyPort”
则没有效果)


有没有一种方法可以将
JAVA_选项
强制到maven的子进程中,而不使用(并且不根据需要更改POM)?

使用
*.
怎么样?在我们的公司网络中,我们通常只根据服务器的主机名来引用服务器,而不使用域或域结尾。所以我认为点是错的?我相信maven希望非ProxyHosts使用字符串,而仅仅使用通配符是不够的,这就是为什么我认为它值得一试,没有运气:
[org.hibernate.util.jdbceptionReporter]-