如何在Netbeans(11)中排除module-info.java? [英] How to exclude module-info.java in Netbeans (11)?
问题描述
我们的源代码仍然符合Java 8,但是我们有两种不同的构建方式:一种是使用JDK 11和module-info.java
构建的.还有一个带有JDK 8而没有module-info.java
的对象.使用Maven,可以很容易地对不同的配置文件进行两项操作.对于JDK 8概要文件,排除module-info.java
:
Our source code is still Java 8 complient, but we have two different builds: one built with JDK 11 and module-info.java
. And one with JDK 8 and without module-info.java
. With maven, this is easy two accomplish with to different profiles. For the JDK 8 profile, module-info.java
is excluded:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
...
<excludes>
<exclude>module-info.java</exclude>
</excludes>
</configuration>
</plugin>
将此项目导入Netbeans 11并激活正确的配置文件后,将忽略excludes
的maven配置.
When this project is imported into Netbeans 11 and the correct profile activated, the maven configuration for excludes
is ignored.
推荐答案
万一有人偶然发现了这个问题,我在这里指出了为什么它(可能)不起作用:
In case anybody stumbles upon this issue, I've indicated here why it (probably) doesn't work:
将Maven项目迁移到模块-忽略module-info.java
这篇关于如何在Netbeans(11)中排除module-info.java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!