Author: epunzalan Date: Wed Jul 19 03:12:20 2006 New Revision: 423422 URL: http://svn.apache.org/viewvc?rev=423422&view=rev Log: PR: MCOMPILER-38
Some site documentation modifications based on Dennis Lundberg's review here: http://www.nabble.com/Please-review-maven-compiler-plugin-tf1959680.html Also, added a mini guide for specifying a non-javac compiler Added: maven/plugins/trunk/maven-compiler-plugin/src/site/apt/non-javac-compilers.apt Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/compile-with-memory-enhancements.apt maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/pass-compiler-arguments.apt maven/plugins/trunk/maven-compiler-plugin/src/site/apt/index.apt maven/plugins/trunk/maven-compiler-plugin/src/site/fml/faq.fml maven/plugins/trunk/maven-compiler-plugin/src/site/site.xml Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java?rev=423422&r1=423421&r2=423422&view=diff ============================================================================== --- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java (original) +++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java Wed Jul 19 03:12:20 2006 @@ -57,7 +57,7 @@ // ---------------------------------------------------------------------- /** - * Whether to include debugging information in the compiled class files. + * Set to true to include debugging information in the compiled class files. * The default value is true. * * @parameter expression="${maven.compiler.debug}" default-value="true" @@ -65,71 +65,72 @@ private boolean debug; /** - * Whether to output messages about what the compiler is doing + * Set to true to show messages about what the compiler is doing. * * @parameter expression="${maven.compiler.verbose}" default-value="false" */ private boolean verbose; /** - * Output source locations where deprecated APIs are used + * Sets whether to show source locations where deprecated APIs are used. * * @parameter expression="${maven.compiler.showDeprecation}" default-value="false" */ private boolean showDeprecation; /** - * Optimize compiled code using the compiler's optimization methods + * Set to true to optimize the compiled code using the compiler's optimization methods. * * @parameter expression="${maven.compiler.optimize}" default-value="false" */ private boolean optimize; /** - * Output warnings + * Set to true to show compilation warnings. * * @parameter expression="${maven.compiler.showWarnings}" default-value="false" */ private boolean showWarnings; /** - * The -source argument for the Java compiler + * The -source argument for the Java compiler. * * @parameter expression="${maven.compiler.source}" */ private String source; /** - * The -target argument for the Java compiler + * The -target argument for the Java compiler. * * @parameter expression="${maven.compiler.target}" */ private String target; /** - * The -encoding argument for the Java compiler + * The -encoding argument for the Java compiler. * * @parameter expression="${maven.compiler.encoding}" */ private String encoding; /** - * The granularity in milliseconds of the last modification - * date for testing whether a source needs recompilation + * Sets the granularity in milliseconds of the last modification + * date for testing whether a source needs recompilation. * * @parameter expression="${lastModGranularityMs}" default-value="0" */ private int staleMillis; /** - * The compiler id of the compiler to use. + * The compiler id of the compiler to use. See this + * <a href="non-javac-compilers.html">guide</a> for more information. * * @parameter expression="${maven.compiler.compilerId}" default-value="javac" */ private String compilerId; /** - * Version of the compiler to use, ex. "1.3", "1.5", if fork is set to true + * Version of the compiler to use, ex. "1.3", "1.5", if fork is set to true. * * @parameter expression="${maven.compiler.compilerVersion}" */ @@ -145,22 +146,22 @@ /** * Initial size, in megabytes, of the memory allocation pool, ex. "64", "64m" - * if fork is set to true + * if fork is set to true. * * @parameter expression="${maven.compiler.meminitial}" */ private String meminitial; /** - * maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" - * if fork is set to true + * Sets the maximum size, in megabytes, of the memory allocation pool, ex. "128", "128m" + * if fork is set to true. * * @parameter expression="${maven.compiler.maxmem}" */ private String maxmem; /** - * The executable of the compiler to use when fork is true. + * Sets the executable of the compiler to use when fork is true. * * @parameter expression="${maven.compiler.executable}" */ @@ -168,7 +169,7 @@ /** * <p> - * Arguments to be passed to the compiler (prepending a dash) if fork is set to true. + * Sets the arguments to be passed to the compiler (prepending a dash) if fork is set to true. * </p> * <p> * This is because the list of valid arguments passed to a Java compiler @@ -181,7 +182,7 @@ /** * <p> - * Unformatted argument string to be passed to the compiler if fork is set to true. + * Sets the unformatted argument string to be passed to the compiler if fork is set to true. * </p> * <p> * This is because the list of valid arguments passed to a Java compiler @@ -193,7 +194,7 @@ private String compilerArgument; /** - * Used to control the name of the output file when compiling a set of + * Sets the name of the output file when compiling a set of * sources to a single file. * * @parameter expression="${project.build.finalName}" Modified: maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/compile-with-memory-enhancements.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/compile-with-memory-enhancements.apt?rev=423422&r1=423421&r2=423422&view=diff ============================================================================== --- maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/compile-with-memory-enhancements.apt (original) +++ maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/compile-with-memory-enhancements.apt Wed Jul 19 03:12:20 2006 @@ -1,12 +1,12 @@ ------ - Preventing OutOfMemory problems during compilation + Compile Using Memory Allocation Enhancements ------ Edwin Punzalan ------ 05 July 2006 ------ -Preventing <<<OutOfMemory>>> problems during compilation +Compile Using Memory Allocation Enhancements The Compiler Plugin accepts configurations for <<<meminitial>>> and <<<maxmem>>>. You can follow the example below to set the initial memory Modified: maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/pass-compiler-arguments.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/pass-compiler-arguments.apt?rev=423422&r1=423421&r2=423422&view=diff ============================================================================== --- maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/pass-compiler-arguments.apt (original) +++ maven/plugins/trunk/maven-compiler-plugin/src/site/apt/examples/pass-compiler-arguments.apt Wed Jul 19 03:12:20 2006 @@ -1,12 +1,12 @@ ------ - Passing Compiler Arguments Using the Compiler Plugin + Pass Compiler Arguments ------ Edwin Punzalan ------ 05 July 2006 ------ -Passing Compiler Arguments Using the Compiler Plugin +Pass Compiler Arguments Sometimes, you need to pass other compiler arguments that are not handled by the Compiler Plugin itself but is supported by the <<<compilerId>>> selected. Modified: maven/plugins/trunk/maven-compiler-plugin/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/site/apt/index.apt?rev=423422&r1=423421&r2=423422&view=diff ============================================================================== --- maven/plugins/trunk/maven-compiler-plugin/src/site/apt/index.apt (original) +++ maven/plugins/trunk/maven-compiler-plugin/src/site/apt/index.apt Wed Jul 19 03:12:20 2006 @@ -13,12 +13,15 @@ default compiler is <<<javac>>> and is used to compile Java sources. Other compilers can be used and work has already started on AspectJ, .NET, and C#. - This Compiler Plugin is Maven 2 version of Maven 1.x's Java Plugin. + This Compiler Plugin is the Maven 2 version of Maven 1.x's Java Plugin. + + <<NOTE:>> <To know more about the Java JDK 1.4 javac, please see: + {{http://java.sun.com/j2se/1.4.2/docs/tooldocs/tools.html#basic}}.> * Goals Overview The Compiler Plugin has two goals. Both are already bound to their proper - phases within the Maven Lifecycles and are therefore, automatically executed + phases within the Maven Lifecycle and are therefore, automatically executed during their respective phases. * {{{compile-mojo.html}compiler:compile}} is bound to the compile phase and @@ -43,4 +46,4 @@ * {{{examples/compile-with-memory-enhancements.html}Compile Using Memory Allocation Enhancement}} - * {{{examples/pass-compiler-arguments.html}Pass Compiler Arguments Using The Compiler Plugin}} + * {{{examples/pass-compiler-arguments.html}Pass Compiler Arguments}} Added: maven/plugins/trunk/maven-compiler-plugin/src/site/apt/non-javac-compilers.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/site/apt/non-javac-compilers.apt?rev=423422&view=auto ============================================================================== --- maven/plugins/trunk/maven-compiler-plugin/src/site/apt/non-javac-compilers.apt (added) +++ maven/plugins/trunk/maven-compiler-plugin/src/site/apt/non-javac-compilers.apt Wed Jul 19 03:12:20 2006 @@ -0,0 +1,61 @@ + ------ + Using Non-Javac Compilers + ------ + Edwin Punzalan + ------ + 19 July 2006 + ------ + + +Using Non-Javac Compilers + + Contrary to this plugin's name, the Compiler Plugin does not compile the + sources of your project by itself. To compile, the Compiler Plugin uses + another class to compile them. The parameter <<<compilerId>>> determines + which class will be used. Currently, the Compiler Plugin is bundled with the + <<<javac>>> compiler artifact with artifactId <<<plexus-compiler-javac>>>, + which can be seen as one of the dependencies declared inside the Compiler + Plugin's POM. + + Plexus have some other compiler Ids available under the groupId + <<<org.codehaus.plexus>>>: + + * <<<aspectj>>> with artifactId <<<plexus-compiler-aspectj>>>. + + * <<<csharp>>> with artifactId <<<plexus-compiler-csharp>>>. + + * <<<eclipse>>> with artifactId <<<plexus-compiler-eclipse>>>. + + * <<<jikes>>> with artifactId <<<plexus-compiler-jikes>>>. + + +* Using The Other Plexus Compilers + + To use any of the non-javac compilers, you need to make the artifact available + in the classpath when the Compiler Plugin runs. This is possible by adding the + dependency when declaring the plugin in your project's pom.xml. The example + below shows how to use the <<<csharp>>> compiler: + ++----- +<project> + [...] + <build> + [...] + <plugins> + [...] + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <compilerId>csharp</compilerId> + </configuration> + <dependencies> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-compiler-csharp</artifactId> + <version>1.5.2</version> + </dependency> + </dependencies> + </plugin> + [...] +</project> ++----- Modified: maven/plugins/trunk/maven-compiler-plugin/src/site/fml/faq.fml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/site/fml/faq.fml?rev=423422&r1=423421&r2=423422&view=diff ============================================================================== --- maven/plugins/trunk/maven-compiler-plugin/src/site/fml/faq.fml (original) +++ maven/plugins/trunk/maven-compiler-plugin/src/site/fml/faq.fml Wed Jul 19 03:12:20 2006 @@ -18,6 +18,7 @@ source directory for compilation in maven. So you don't have to copy the generated sources.</p> <p>You have to declare the modello-plugin in the build of your plugin for source generation (in that way the sources are generated each time).</p> + <p>The Modello website can be found <a href="http://modello.codehaus.org/">here</a>.</p> </answer> </faq> </part> Modified: maven/plugins/trunk/maven-compiler-plugin/src/site/site.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/site/site.xml?rev=423422&r1=423421&r2=423422&view=diff ============================================================================== --- maven/plugins/trunk/maven-compiler-plugin/src/site/site.xml (original) +++ maven/plugins/trunk/maven-compiler-plugin/src/site/site.xml Wed Jul 19 03:12:20 2006 @@ -34,6 +34,7 @@ <menu name="Overview"> <item name="Introduction" href="index.html"/> + <item name="Non-javac compilerIds" href="non-javac-compilers.html"/> <item name="Goals" href="plugin-info.html"/> <item name="Usage" href="usage.html"/> <item name="FAQ" href="faq.html"/> @@ -43,7 +44,7 @@ <item name="Compile Using A Different JDK" href="examples/compile-using-different-jdk.html"/> <item name="Compile Using -source and -target javac Options" href="examples/set-compiler-source-and-target.html"/> <item name="Compile Using Memory Allocation Enhancements" href="examples/compile-with-memory-enhancements.html"/> - <item name="Pass Compiler Arguments Using The Compiler Plugin" href="examples/pass-compiler-arguments.html"/> + <item name="Pass Compiler Arguments" href="examples/pass-compiler-arguments.html"/> </menu> ${reports}