0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Maven Pluginを特定Profileでは実行しない方法

Last updated at Posted at 2015-09-26

目的

maven pluginを特定 profileでは実行したくない

経緯

mavenで Javaウェブアプリケーションのpackaging時 jsとcssをcompressするため、yuicompressor-maven-plugin使っているが、開発時は compressが走らないようにしたい。
開発結果の packaging時も compressが走ってしまい、jsとcssの確認が難しくなるし、compressされた状態で commitするケースも発生する。

対応方法

対象profileの buildタグに <phase/>のplugin定義を追加

<profile>
    <id>dev</id>
    ...
    <build>
        ...
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>yuicompressor-maven-plugin</artifactId>
                <version>1.5.1</version>
                <executions>
                    <execution>
                        <phase/>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>

参考

Disable a Maven plugin defined in a parent POM
In a Maven multi-module project, how can I disable a plugin in one child?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?