[fedora-java] Problem with maven-antrun-plugin task being run with the jre rather than the jdk
Stanislav Ochotnicky
sochotnicky at redhat.com
Wed Dec 5 12:34:58 UTC 2012
Quoting Orion Poplawski (2012-12-04 16:38:00)
> On 12/04/2012 01:07 AM, Mikolaj Izdebski wrote:
> >> 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
> >
>
> That's already there, although perhaps not in the right place? See attached
> pom.xml. Or maybe because the version is too old?
That mapping is in a profile which only gets activated with Sun JDK. This is
wrong. Moving the dependency into proper build/plugins section should solve the
issue. I am not entirely sure why upstream decided to put it into profile. Maybe
something to do with macs? Maybe some fix could be upstreamed too...
--
Stanislav Ochotnicky <sochotnicky at redhat.com>
Software Engineer - Base Operating Systems Brno
PGP: 7B087241
Red Hat Inc. http://cz.redhat.com
More information about the java-devel
mailing list