Hi.

I'm working on a project where I bootstrap the compiler.  I have it
working but the POM configuration for the compiler does not do what I
expect.  I wonder whether this is a bug or there's something I do not
understand.

What I have to do is:

1. Use a specified compiler (javac from a given JDK directory).
2. Prepend the bootstrap classpath when compiling tests.

So what I did is I specified the configuration, and then I specified a
specific execution for the test-compile.  And I thought the
configuration would carry over into the test-compile execution.  But
that is not happening.  I actually don't know exactly what is the
ultimate effective configuration, but the compile fails because the
bootstrapping is not happening.

So this is what that plugin configuration would have looked like I
though.  Note that the email may hard-wrap one or two long lines.


<plugin>

    <!-- 
      - Use the mustang compiler.
     -->
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <compilerVersion>6</compilerVersion>
        <fork>true</fork>
        <source>5</source>
        <target>6</target>
        <executable>${project.mustangHome}/bin/javac</executable>
        <compilerArgument>-deprecation</compilerArgument>
        <compilerArgument>-Xlint</compilerArgument>
    </configuration>
    <executions>
        <execution>
            <phase>test-compile</phase>
            <goals>
                <goal>testCompile</goal>
            </goals>
            <configuration>
                <compilerArgument>-Xbootclasspath/p:
${project.build.outputDirectory}:${project.junitJar}</compilerArgument>
            </configuration>
        </execution>
    </executions>
</plugin>


This doesn't work.  The working solution is below.  I found a workaround
for me by simply including the bootstrapping into the main configuration
and eliminating the test-compile execution.  This does work but is not
the logical solution.  And it does seem like a bug here.

Anyone have any thoughts?  Maybe I should file a bug?

The working configuration is as follows:


<plugin>

    <!-- 
      - Use the mustang compiler.
     -->
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <compilerVersion>6</compilerVersion>
        <fork>true</fork>
        <source>5</source>
        <target>6</target>
        <executable>${project.mustangHome}/bin/javac</executable>
        <compilerArgument>-deprecation</compilerArgument>
        <compilerArgument>-Xlint</compilerArgument>
        <compilerArgument>-Xbootclasspath/p:
${project.build.outputDirectory}:${project.junitJar}</compilerArgument>
    </configuration>
</plugin>


- Steven Coco.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to