I have a case where I to modify the version used by a transitive plugin
dependency and I'm not sure the best way to do this.

In my use case I have maven-antrun-plugin which has a dependency on
fmpp-maven-plugin which has a dependency on fmpp which uses version ranges
to specify its 4 dependencies one of those being freemarker.  I need to fix
the version of freemarker (and maybe the other 3), how best can I do this?

I'm assuming I can't use my top level pluginManagement section because it's
not a plugin that I need to mange the version of.  And I'm assuming I can't
use dependencyManagement for this because it's not a project dependency
that I need to mange either.

So what I have so far is exclude and then re-include in the plugin config.
 Is this the right/best way to do this?

<plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>ant-contrib</groupId>
                                <artifactId>ant-contrib</artifactId>
                                <version>${ant-contrib.version}</version>
                                <exclusions>
                                    <exclusion>
                                        <groupId>ant</groupId>
                                        <artifactId>ant</artifactId>
                                    </exclusion>
                                </exclusions>
                            </dependency>
                            <dependency>
                                <groupId>org.apache.ant</groupId>
                                <artifactId>ant-nodeps</artifactId>
                                <version>${ant-nodeps.version}</version>
                            </dependency>
                            <dependency>

<groupId>com.googlecode.fmpp-maven-plugin</groupId>
                                <artifactId>fmpp-maven-plugin</artifactId>

<version>${fmpp-maven-plugin.version}</version>
                                <exclusions>
                                    <exclusion>
                                        <groupId>org.freemarker</groupId>
                                        <artifactId>freemarker</artifactId>
                                    </exclusion>
                                </exclusions>
                            </dependency>
                            <dependency>
                                <groupId>org.freemarker</groupId>
                                <artifactId>freemarker</artifactId>
                                <version>${freemarker.version}</version>
                            </dependency>
                        </dependencies>

-Dave

Reply via email to