如何禁用maven-compiler-plugin? [英] How do I disable the maven-compiler-plugin?

查看:219
本文介绍了如何禁用maven-compiler-plugin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Aspectj-compiler-plugin的Maven项目.我使用类型间声明,因此我的Java代码中有对Aspect代码的引用.因此,maven-compiler-plugin无法编译方面代码,因此无法编译.

I have a maven project that uses the aspectj-compiler-plugin. I use intertype declarations so there are references to Aspect code in my Java code. Because of this, the maven-compiler-plugin fails to compile since it does not compile the aspect code.

我的问题是:由于未执行任何有用的操作,如何禁用maven-compiler-plugin?

My question is: how do I disable the maven-compiler-plugin from running because it is not doing anything useful?

我可以通过几种方法来编译该项目,但是它们不是最优的:

There are several ways that I can get this project compiling, but they are sub-optimal:

  1. 将排除过滤器添加到maven-compiler-plugin.该插件仍将运行,但不会尝试编译任何内容.问题在于,这会破坏Eclipse中的ajdt项目配置程序
  2. 将所有Java代码移动到Aspectj文件夹中.感觉也不对.

推荐答案

您可以通过将插件的阶段设置为无来禁用该插件.

You can disable the a plugin by set the phase of the plugin to none.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
                <execution>
                    <id>default-compile</id>
                    <phase>none</phase>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

这篇关于如何禁用maven-compiler-plugin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆