Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 马文战争胜利';不排除依赖性_Maven_Maven War Plugin - Fatal编程技术网

Maven 马文战争胜利';不排除依赖性

Maven 马文战争胜利';不排除依赖性,maven,maven-war-plugin,Maven,Maven War Plugin,我有一个项目,我试图用另一个模块中编译的jar和war项目中的一些文件覆盖一个预构建的war +pom.xml | +-+depandancy_dir | | | + source.war | +-+ jar | | | + pom.xml | + src | ... | +-+war_dir | + pom.xml + src .... no jars 我想排除一些配置为jar的maven依赖项的jar 我在pom中为战争尝试了以下所有排除行。不管怎样,不想要的罐子都会

我有一个项目,我试图用另一个模块中编译的jar和war项目中的一些文件覆盖一个预构建的war

+pom.xml
|
+-+depandancy_dir
| |
| + source.war
|
+-+ jar
| |
| + pom.xml
| + src
|  ...
|
+-+war_dir
  |
  + pom.xml
  + src
    .... no jars
我想排除一些配置为jar的maven依赖项的jar

我在pom中为战争尝试了以下所有排除行。不管怎样,不想要的罐子都会出现

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <dependentWarExcludes>**/unwanted-core-1.1.jar</dependentWarExcludes>
                <overlays>
                    <overlay>
                       <groupId>src.war</groupId>
                       <artifactId>base.war</artifactId>

                       <excludes>
                            <exclude>**/unwanted-core-1.1.jar</exclude>     
                            <packagingExcludes>**/unwanted-core-1.1.jar</packagingExcludes>                           
                            <exclude>WEB-INF/lib/unwanted-core-1.1.jar</exclude>     
                            <packagingExcludes>WEB-INF/lib/unwanted-core-1.1.jar</packagingExcludes>                           
                       </excludes>

                    </overlay>
                </overlays>
            </configuration>
        </plugin>

org.apache.maven.plugins
maven战争插件
**/不需要的-core-1.1.jar
src.war
基地战争
**/不需要的-core-1.1.jar
**/不需要的-core-1.1.jar
WEB-INF/lib/core-1.1.jar
WEB-INF/lib/core-1.1.jar
我在eclipse下运行maven。
war插件报告版本maven war插件:2.2:war

结果表明我试图以错误的方式解决问题。排除在依赖项上

  <dependencies>
        <dependency>
        <!-- the jar of custom code -->
            <groupId>my.group</groupId>
            <artifactId>jar</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <exclusions>
               <exclusion>  <!-- declare the exclusion here -->
                    <groupId>org.unwanted</groupId>
                    <artifactId>unwanted-core</artifactId>
               </exclusion>
            </exclusions>
        </dependency>
        <dependency>
<!-- the war I am overlaying -->
            <groupId>my.group</groupId>
            <artifactId>a.base.war</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/../dependancies/jreport.war</systemPath>
            <type>war</type>
        </dependency>

  </dependencies>

我的团队