You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by James Kebinger <jk...@gmail.com> on 2006/12/22 20:47:04 UTC
Can profiles override plugin dependencies?
I have a project with a plugin that depends on tools.jar. That jar doesn't
exist on the mac, so I'm trying to use profiles to change that dependency
when running on OSX. I think the pom I wrote below should work, but it
doesn't. What am i missing?
(The profile is shown as active running help:active-profiles)
thanks for your time
Here's a snippet of the pom:
<project>
...
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
...
</executions>
<dependencies>
<dependency>
<!-- Required to use javac -->
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.5</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>macfixfortools</id>
<activation>
<os>
<family>OSX</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<!-- Required to use javac -->
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.5</version>
<scope>system</scope>
<systemPath>${java.home
}/../Classes/classes.jar</systemPath>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Re: Can profiles override plugin dependencies?
Posted by James Kebinger <jk...@gmail.com>.
Just tried that - removed the tools.jar dependency from the plugin's
dependency list and had two profiles. Testing on windows showed this
approach does not work: javac is not found in the classpath so the
dependency information from the "not mac" profile I created was not used.
On 12/22/06, Tom Huybrechts <to...@gmail.com> wrote:
>
> Have you tried putting both configurations in a profile ?
>
>
> On 12/22/06, James Kebinger <jk...@gmail.com> wrote:
> > I have a project with a plugin that depends on tools.jar. That jar
> doesn't
> > exist on the mac, so I'm trying to use profiles to change that
> dependency
> > when running on OSX. I think the pom I wrote below should work, but it
> > doesn't. What am i missing?
> > (The profile is shown as active running help:active-profiles)
> >
> > thanks for your time
> >
> > Here's a snippet of the pom:
> >
> > <project>
> > ...
> > <build>
> > <plugins>
> > <plugin>
> > <artifactId>maven-antrun-plugin</artifactId>
> > <executions>
> > ...
> > </executions>
> > <dependencies>
> > <dependency>
> > <!-- Required to use javac -->
> > <groupId>sun.jdk</groupId>
> > <artifactId>tools</artifactId>
> > <version>1.5</version>
> > <scope>system</scope>
> > <systemPath>${java.home}/../lib/tools.jar</systemPath>
> > </dependency>
> > </dependencies>
> > </plugin>
> > </plugins>
> > </build>
> >
> > <profiles>
> > <profile>
> > <id>macfixfortools</id>
> > <activation>
> > <os>
> > <family>OSX</family>
> > </os>
> > </activation>
> > <build>
> > <plugins>
> > <plugin>
> > <artifactId>maven-antrun-plugin</artifactId>
> > <dependencies>
> > <dependency>
> > <!-- Required to use javac -->
> > <groupId>sun.jdk</groupId>
> > <artifactId>tools</artifactId>
> > <version>1.5</version>
> > <scope>system</scope>
> > <systemPath>${java.home
> > }/../Classes/classes.jar</systemPath>
> > </dependency>
> > </dependencies>
> > </plugin>
> > </plugins>
> > </build>
> > </profile>
> > </profiles>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Can profiles override plugin dependencies?
Posted by Tom Huybrechts <to...@gmail.com>.
Have you tried putting both configurations in a profile ?
On 12/22/06, James Kebinger <jk...@gmail.com> wrote:
> I have a project with a plugin that depends on tools.jar. That jar doesn't
> exist on the mac, so I'm trying to use profiles to change that dependency
> when running on OSX. I think the pom I wrote below should work, but it
> doesn't. What am i missing?
> (The profile is shown as active running help:active-profiles)
>
> thanks for your time
>
> Here's a snippet of the pom:
>
> <project>
> ...
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> ...
> </executions>
> <dependencies>
> <dependency>
> <!-- Required to use javac -->
> <groupId>sun.jdk</groupId>
> <artifactId>tools</artifactId>
> <version>1.5</version>
> <scope>system</scope>
> <systemPath>${java.home}/../lib/tools.jar</systemPath>
> </dependency>
> </dependencies>
> </plugin>
> </plugins>
> </build>
>
> <profiles>
> <profile>
> <id>macfixfortools</id>
> <activation>
> <os>
> <family>OSX</family>
> </os>
> </activation>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <dependencies>
> <dependency>
> <!-- Required to use javac -->
> <groupId>sun.jdk</groupId>
> <artifactId>tools</artifactId>
> <version>1.5</version>
> <scope>system</scope>
> <systemPath>${java.home
> }/../Classes/classes.jar</systemPath>
> </dependency>
> </dependencies>
> </plugin>
> </plugins>
> </build>
> </profile>
> </profiles>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org