如何从同一个pom中定义的插件中排除pom.xml中定义的依赖项

时间:2014-06-19 18:41:55

标签: maven plugins dependencies pom.xml

我有一个pom.xml,其中我将依赖项定义为:

<dependency> 
            <groupId>abc.xyz.pig</groupId>
            <artifactId>pig</artifactId> 
            <version>10</version> 
            <scope>provided</scope>
        </dependency> 

我想在同一个文件中定义一个新插件,我需要更高版本的相同依赖项。如何让我的插件使用更高版本的依赖项并忽略上面定义的较低版本?

我尝试在我的插件定义中添加新版本的依赖关系,但是它没有工作:

<plugin>
    <groupId>my_plugin</groupId>
    <artifactId>my_plugin_artifact</artifactId>
    <version>0.1.1</version>        
    <executions>
          <execution>
            <goals>
              <goal>my_plugin_goal</goal>
            </goals>
          </execution>
    </executions>
    <dependencies>
        <dependency>
          <groupId>abc.xyz.pig</groupId>
          <artifactId>pig</artifactId>
          <version>11</version>
        </dependency>
   </dependencies>
</plugin>

0 个答案:

没有答案