maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Adams (JIRA)" <j...@codehaus.org>
Subject [jira] (MCOMPILER-132) Provide general "maven.compiler.main.skip" attribute
Date Sun, 03 Feb 2013 15:26:13 GMT

    [ https://jira.codehaus.org/browse/MCOMPILER-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=318591#comment-318591
] 

Matthew Adams commented on MCOMPILER-132:
-----------------------------------------

@Olivier, I was looking at the source (http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java?view=markup&pathrev=1441839),
and noticed four things:

1. The log message when main compilation is being skipped says "Not compiling test sources".
 It should say "Not compiling main sources".

2. The property is not symmetrical with the corresponding property in TestCompilerMojo.  In
TestCompilerMojo, it's called "maven.test.skip", but in the new revision of CompilerMojo,
it's called "maven.compiler.main.skip" -- according to the principle of least surprise, it
should be called "maven.main.skip", unless you propose deprecating "maven.test.skip" in favor
of "maven.compiler.test.skip" or "maven.testCompiler.test.skip".  I favor less typing &
thus "maven.main.skip".

3. Skipping main compilation implies skipping test compilation, otherwise the build would
fail.  To make the build succeed, the user would have to set both properties, which is inconvenient.
 Is it possible, if CompilerMojo.test is true, to force TestCompilerMojo.test to be true also
within a given project's execution?

4. The property on both CompilerMojo & TestCompilerMojo is called "skip".  By calling
it the same name, if someone has set <skip>true</skip> in the topmost <configuration>
element of the maven-compiler-plugin in a pom, not only will test compilation be skipped,
but also main compilation will be skipped.  This will have unintended consequences on existing
uses of maven-compiler-plugin, since people up to now have been using it only to skip test
compilation.  I recommend, for backward compatibility purposes, that the CompilerMojo field
be named "skipMain", and that TestCompilerMojo.test be deprecated, and a new TestCompilerMojo
field called "skipTest" be added, making TestCompilerMojo.skip a synonym of TestCompilerMojo.skipTest.

Thoughts?
                
> Provide general "maven.compiler.main.skip" attribute
> ----------------------------------------------------
>
>                 Key: MCOMPILER-132
>                 URL: https://jira.codehaus.org/browse/MCOMPILER-132
>             Project: Maven 2.x Compiler Plugin
>          Issue Type: New Feature
>            Reporter: Dieter K├Ânig
>            Assignee: Olivier Lamy
>            Priority: Minor
>             Fix For: 3.1
>
>
> Please provide general "maven.compiler.main.skip" attribute which will allow to skip
all executions of compiler plugin.
> Desired usecase:
> Execution of profile's where compilation of sources is not needed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message