开发者

maven: (use -source 5 or higher to enable static import declarations)

开发者 https://www.devze.com 2022-12-22 20:39 出处:网络
How can I use source 5? I tried mv开发者_开发百科n -source 5 test but it didn\'t work :-) When I compile the file by javac, everything works.You need to configure the maven-compiler-plugin:

How can I use source 5? I tried

mv开发者_开发百科n -source 5 test

but it didn't work :-)

When I compile the file by javac, everything works.


You need to configure the maven-compiler-plugin:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      ...
    </plugins>
    ...
  </build>
</project>

EDIT: Changed example to use latest version of the plugin.

0

精彩评论

暂无评论...
验证码 换一张
取 消