geo*_*xis 5 java annotations maven
我已经有了一个工作解决方案,我可以在其中使用 maven 指定在使用特定 maven 配置文件时不编译哪些类。
但我想使用通用解决方案并使用注释代替
我目前的解决方案就像
<plugin>
<!-- Exclude some web services used only for internal testing -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<optimize>true</optimize>
<excludes>
<exclude>**/something/*ClassPattern.java</exclude>
</excludes>
<testExcludes>
<exclude>**/something/*ClassPatternTest.java</exclude>
</testExcludes>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
但有些事情像
@NotCompiledForProduction
Run Code Online (Sandbox Code Playgroud)
在课堂上会相当不错。
在我看来,如果不改变 maven 的行为,这可能很难(或不可能做到)。这不是这里的范围。还有这种注解
小智 0
你可以试试这个...
<build> <plugins>
<!-- Run annotation processors on src/main/java sources -->
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
<!-- Disable annotation processors during normal compilation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
</plugins> </build>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4581 次 |
| 最近记录: |