如何打印正在使用的实际MAVEN_OPTIONS? [英] How to print the actual MAVEN_OPTIONS that are being used?

查看:109
本文介绍了如何打印正在使用的实际MAVEN_OPTIONS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建过程中有没有办法让maven输出环境和maven变量的值?

解决方案

您可以使用 Maven帮助插件帮助:系统目标,所以你的pom将是:

 < 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> testMavenOpt< / groupId>
< artifactId> testMavenOpt< / artifactId>
< packaging> jar< / packaging>
< version> 1.0-SNAPSHOT< / version>
< name> testMavenOpt< / name>
< url> http://maven.apache.org< / url>
<依赖关系>
<依赖关系>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 3.8.1< / version>
< scope> test< / scope>
< / dependency>
< / dependencies>
< build>
< plugins>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-help-plugin< / artifactId>
< version> 2.1< / version>
< / plugin>
< / plugins>
< / build>
< / project>

您应该执行 mvn help:system


Is there a way to get maven to output the value of environment and maven variables during a build? This would be very useful for debugging things when they're going wrong.

解决方案

You can use Maven Help Plugin and help:system goal, so your pom will be:

<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>testMavenOpt</groupId>
    <artifactId>testMavenOpt</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>testMavenOpt</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-help-plugin</artifactId>
                <version>2.1</version>
            </plugin>
        </plugins>
    </build>
</project>

and you should execute mvn help:system

这篇关于如何打印正在使用的实际MAVEN_OPTIONS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆