简体   繁体   English

maven-archetype-quickstart 使用 Java5 创建 Maven 项目

[英]maven-archetype-quickstart create Maven Project with Java5

When i try to create a Maven Project using the following command:当我尝试使用以下命令创建 Maven 项目时:

mvn archetype:create -DgroupId=[your project's group id] -DartifactId=[your project's artifact id] -DarchetypeArtifactId=maven-archetype-quickstart mvn archetype:create -DgroupId=[您项目的组 ID] -DartifactId=[您项目的工件 ID] -DarchetypeArtifactId=maven-archetype-quickstart

JRE set to 1.5 as default. JRE 默认设置为 1.5。 I want to have JRE 7 as default for my project.我想将 JRE 7 作为我的项目的默认值。

I've never used an archetype, but if all you want to do is to change the Java version used to compile, just add this to your POM, under <plugins /> :我从未使用过原型,但如果您只想更改用于编译的 Java 版本,只需将其添加到您的 POM 中,在<plugins />

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <configuration>
        <source>1.7</source>
        <target>1.7</target>
    </configuration>
</plugin>

Or the equivalent property short version:或等效的property简短版本:

<properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
</properties>

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

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