开发者

How to override configuration of maven-compiler-plugin. (build directory, I want to change by using profile)

I want to ignore some build errors at a specific directory by using maven's profile. I tried to do like below but it did not work. Any help will be appreciated?

============================================
[executed command]

mvn -P test clean compile

============================================
[part of pom.xml]

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.5</source>
                <target>1.5</target>
                <showWarnings>true</showWarnings>
            </configuration>
        </plugin>
    </plugins>
</build>
<profiles>
    <profile>
        <id>test</id>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.5</source>
                        <target>1.5</target>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-compile</id>
                            <configuration>
                                <excludes>
                                    <exclude>**/nocompile/*</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

============================================
[开发者_如何学Pythona class happened a build error]

package com.sample.web.nocompile;

public class NoCompileSample {

    // An error do happen here 
    private String

}


Your profile looks alright. There seems to be a known issue with the maven compiler though. See this answer to a similar question for a description of the problem and a workaround.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜