简体   繁体   中英

maven-archetype-quickstart create Maven Project with Java5

When i try to create a Maven Project using the following command:

mvn archetype:create -DgroupId=[your project's group id] -DartifactId=[your project's artifact id] -DarchetypeArtifactId=maven-archetype-quickstart

JRE set to 1.5 as default. I want to have JRE 7 as default for my project.

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 /> :

<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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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