-
Notifications
You must be signed in to change notification settings - Fork 175
Update the "non-javac-compilers" guide and add an integration test. #937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Hi, will have a look in the next days or next weekend. Modt prob during the next days, when at an unconference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good, only small suggestions/questions
<configuration> | ||
<compilerId>eclipse</compilerId> | ||
<compilerId>ecj</compilerId> | ||
<!-- TODO: remove source and target after we identified where Maven inherits those values. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to create an issue for this, so it's more visible
public static void main(final String[] args) { | ||
String dummy = new Integer(1); | ||
System.out.println("Hi!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
is not Hello world
:D
Currently, the Compiler Plugin is bundled with the <<<javac>>> compiler | ||
with artifactId <<<plexus-compiler-javac>>> version <<${plexusCompilerVersion}>>, | ||
which can be seen as one of the dependencies declared inside the Compiler Plugin's POM. | ||
By default, the Compiler Plugin uses the <<<javac>>> compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, the Compiler Plugin uses the <<<javac>>> compiler | |
By default, the Maven Compiler Plugin uses the <<<javac>>> compiler |
which can be seen as one of the dependencies declared inside the Compiler Plugin's POM. | ||
By default, the Compiler Plugin uses the <<<javac>>> compiler | ||
bundled in the <<<javax.tools>>> package of the standard Java library. | ||
But it is possible to use any other implementation, provided that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reads bumby, maybe this is a little less rocky?
But it is possible to use any other compiler, as long the implementation declares itself as a ....
bundled in the <<<javax.tools>>> package of the standard Java library. | ||
But it is possible to use any other implementation, provided that the | ||
implementation declares itself as a <<<javax.tools.JavaCompiler>>> service. | ||
For using such implementation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For using such implementation: | |
To use such an implementation: |
dependency when declaring the plugin in your project's <<<pom.xml>>>. The example | ||
below shows how to use the <<<csharp>>> compiler: | ||
The example below shows how to use the Eclipse compiler <<<ecj>>>. | ||
Note that at the contrary of Maven 3, there is no Plexus dependency to add. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does Plexus pops up here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Maven 3, it was necessary to add two dependencies:
- The Eclipse compiler
- A Plexus extension which was a wrapper around the Eclipse compiler.
Actually, the Plexus extension had the Eclipse compiler as a transitive dependency, so it may look as a single dependency in the pom.xml
.
In Maven 4, there is no longer wrappers around the various compilers. The Eclipse compiler is used directly (through the standard javax.tools.JavaCompiler
interface). I mentioned that in case some users were aware of the use of Plexus as an intermediate API, and were wondering whether Plexus was still needed. But I have no problem in omitting this details if too distracting.
dependency when declaring the plugin in your project's <<<pom.xml>>>. The example | ||
below shows how to use the <<<csharp>>> compiler: | ||
The example below shows how to use the Eclipse compiler <<<ecj>>>. | ||
Note that at the contrary of Maven 3, there is no Plexus dependency to add. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this configuration is limited to Maven 3/4 or useable with both? Maybe should be noticed to be clear (esp. as some things are only limit to version 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration (without Plexus) works with the Maven Compiler Plugin 4 only, which itself requires Maven 4.
Fix #904.