相关疑难解决方法(0)

Maven中的"空"与"空"参数

为什么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

12
推荐指数
1
解决办法
6199
查看次数

查找Maven使用的Java选项

我怎样才能找到Maven正在使用哪些Java选项(Xmx,Xms,Xss等)?

我发现设置它们的方法是通过环境MAVEN_OPTS.现在我想要一种方法来确保它获得正确的设置.

编辑:我认为这与这个问题不同,因为我不想看到环境变量的价值.我更愿意看看Maven实际使用了哪些设置,无论是来自env var,settings.xml还是其他方法.

编辑2:我也对为Maven构建设置Java选项的其他方法感兴趣

java jvm-arguments maven-3 maven java-opts

10
推荐指数
2
解决办法
1万
查看次数

如何使用pom.xml插件添加VM args

我尝试了以下方法,但没有任何工作...我试图从服务器远程访问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)

java vmargs pom.xml maven

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

maven ×3

java ×2

java-opts ×1

jvm-arguments ×1

maven-3 ×1

pom.xml ×1

vmargs ×1