Re: Problem with maven-antrun-plugin task being run with the jre rather than the jdk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       orion@xxxxxxxx
Boulder, CO 80301                   http://www.nwra.com
<?xml version="1.0" encoding="UTF-8"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";
	xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.eclipse.ptp</groupId>
		<artifactId>ptp-parent</artifactId>
		<version>6.0.2-SNAPSHOT</version>
		<relativePath>../../pom.xml</relativePath>
	</parent>

	<artifactId>org.eclipse.ptp.rdt.core.remotejars</artifactId>
	<version>6.0.2-SNAPSHOT</version>
	<packaging>eclipse-plugin</packaging>

	<profiles>
		<profile>
			<id>tools.jar</id>
			<activation>
				<property>
					<name>java.vendor</name>
					<value>Sun Microsystems Inc.</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<dependencies>
							<dependency>
								<groupId>com.sun</groupId>
								<artifactId>tools</artifactId>
								<version>1.5.0</version>
								<scope>system</scope>
								<systemPath>${java.home}/../lib/tools.jar</systemPath>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
  
	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-packaging-plugin</artifactId>
				<version>${tycho-version}</version>
				<configuration>
				  <strictBinIncludes>false</strictBinIncludes>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.1</version>
				<dependencies>
					<dependency>
						<groupId>ant</groupId>
						<artifactId>ant-trax</artifactId>
						<version>1.6.5</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>rdt-remote-jars</id>
						<goals>
							<goal>run</goal>
						</goals>
						<phase>package</phase>
						<inherited>false</inherited>
						<configuration>
							<tasks>
								<ant target="server.all">
									<property name="serverVersion" value="${unqualifiedVersion}"/>
									<property name="buildQualifier" value="${buildQualifier}"/>
								</ant>
							</tasks>
						</configuration>
					</execution>
					<execution>
						<id>rdt-remote-jars-clean</id>
						<goals>
							<goal>run</goal>
						</goals>
						<phase>clean</phase>
						<inherited>false</inherited>
						<configuration>
							<tasks>
								<ant target="clean">
									<property name="serverVersion" value="${unqualifiedVersion}"/>
									<property name="buildQualifier" value="${buildQualifier}"/>
								</ant>
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
--
java-devel mailing list
java-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/java-devel

[Index of Archives]     [Red Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux