为什么Maven坚持要处理空字符串和空格字符串"空值"?采取以下pom - 我得到关于错误配置的参数的常见虚假消息.我如何安排传递一个Maven实际上会识别的空值,而不是用荒谬的错误信息折磨我?
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Misconfigured argument, value is null. Set the argument to an empty value if this is the required behaviour.
Run Code Online (Sandbox Code Playgroud)
pom.xml中:
<project 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<packaging>pom</packaging>
<version>0</version>
<name>test</name>
<url>http://maven.apache.org</url>
<properties>
<my.val> </my.val>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>Exec test</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${env.JAVA_HOME}/bin/java</executable>
<arguments>
<argument>${my.val}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud) 我怎样才能找到Maven正在使用哪些Java选项(Xmx,Xms,Xss等)?
我发现设置它们的方法是通过环境MAVEN_OPTS.现在我想要一种方法来确保它获得正确的设置.
编辑:我认为这与这个问题不同,因为我不想看到环境变量的价值.我更愿意看看Maven实际使用了哪些设置,无论是来自env var,settings.xml还是其他方法.
编辑2:我也对为Maven构建设置Java选项的其他方法感兴趣
我尝试了以下方法,但没有任何工作...我试图从服务器远程访问jmx.
<jvmArgs>
<jvmArg>-Dcom.sun.management.jmxremote.port=9999</jvmArg>
<jvmArg>-Dcom.sun.management.jmxremote.authenticate=false</jvmArg>
<jvmArg>-Dcom.sun.management.jmxremote.ssl=false</jvmArg>
</jvmArgs>
<!-- <systemPropertyVariables>
<com.sun.management.jmxremote.port>9999</com.sun.management.jmxremote.port>
<com.sun.management.jmxremote.authenticate>false</com.sun.management.jmxremote.a uthenticate>
<com.sun.management.jmxremote.ssl>false</com.sun.management.jmxremote.ssl>
</systemPropertyVariables> -->
<!-- <jvmArguments>
<jvmArgument>- Dcom.sun.management.jmxremote.port=9999</jvmArgument>
<jvmArgument>- Dcom.sun.management.jmxremote.authenticate=false</jvmArgument>
<jvmArgument>- Dcom.sun.management.jmxremote.ssl=false</jvmArgument>
</jvmArguments> -->
Run Code Online (Sandbox Code Playgroud)
我也试过了
<options>
<option>-Dcom.sun.management.jmxremote.port=9999</option>
<option>-Dcom.sun.management.jmxremote.authenticate=false</option>
<option>-Dcom.sun.management.jmxremote.ssl=false</option>
</options>
Run Code Online (Sandbox Code Playgroud)