[fedora-java] Problem with maven-antrun-plugin task being run with the jre rather than the jdk

Mikolaj Izdebski mizdebsk at redhat.com
Tue Dec 4 08:07:46 UTC 2012


>    seem to be facing a classic issue with a maven-antrun-plugin task being run 
> with the jre rather than the jdk and not finding the compiler.  Haven't yet 
> found the proper fix though.  Any ideas?

Java compiler is in tools.jar, you need to add it to classpath of antrun plugin
explicitly, for example:

<plugins>
  <plugin>
    <artifactId>maven-antrun-plugin</artifactId>
    [...]
    <dependencies>
      <dependency>
        <groupId>com.sun</groupId>
        <artifactId>tools</artifactId>
        <version>1.7</version>
        <scope>system</scope>
        <systemPath>${java.home}/../lib/tools.jar</systemPath>
      </dependency>
    </dependencies>
  </plugin>
</plugins>

Mikolaj


More information about the java-devel mailing list