繁体   English   中英

用Maven编译gwt-指定jvm

[英]Compiling gwt with maven - specify jvm

我试图在我的maven settings.xml和pom.xml中指定要用于我的gwt项目的jvm。

我正在使用来自https://stackoverflow.com/a/20787334/265119的建议。 我已经成功地在其他非gwt项目上使用了它。

但是现在看来,maven忽略了这一点,并继续使用Java 8,而我在settings.xml中设置了以下内容:

<profiles>        
<profile>
<id>default</id>
    <properties>
            <JAVA_1_7_HOME>/usr/lib/jvm/java-7-oracle/bin/javac</JAVA_1_7_HOME>
            <JAVA_1_8_HOME>/usr/lib/jvm/java-8-oracle/bin/javac</JAVA_1_8_HOME>
        </properties>
</profile>
  </profiles>
  <activeProfiles>
    <activeProfile>default</activeProfile>
</activeProfiles>

在我的pom.xml中:

 <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <executable>${JAVA_1_7_HOME}</executable>
                    </configuration>
                </plugin>

有谁知道为什么maven会忽略这些? gwt maven插件还需要指定jvm版本吗?

谢谢

个人资料是否真的被激活? 您的POM应该可以工作,但前提是已激活配置文件。

您可以运行mvn help:active-profiles来查看您的配置文件是否处于活动状态。

另外,为了使<executable>正常工作,还需要设置<fork>true</fork> 如此处所述: http : //maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#executable

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM