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 POM依赖项和程序集_Maven - Fatal编程技术网

Maven POM依赖项和程序集

Maven POM依赖项和程序集,maven,Maven,我在pom.xml中依赖type=pom。在这个依赖项中,我有一组type=jar的依赖项 现在,我需要将其中一些jar添加到组装中 (包含它们以使用dependencySet->includes生成) 如果我将POM依赖项的组和工件设置为“include”,我将在构建中得到结果POM.xml 如果我将外部pom的依赖项设置为“include”组和工件,我会得到一个构建错误: 程序集配置不正确:一个或多个筛选器的条件不匹配 有人见过这个问题吗 这是我的主要POM: <depende

我在
pom.xml
中依赖
type=pom
。在这个依赖项中,我有一组
type=jar
的依赖项

现在,我需要将其中一些jar添加到组装中 (包含它们以使用dependencySet->includes生成)

如果我将POM依赖项的组和工件设置为
“include”
,我将在构建中得到结果POM.xml

如果我将外部pom的依赖项设置为“include”组和工件,我会得到一个构建错误:

程序集配置不正确:一个或多个筛选器的条件不匹配

有人见过这个问题吗

这是我的主要POM:

    <dependency>
        <groupId>slf4j</groupId>
        <artifactId>slf4j</artifactId>
        <type>pom</type>
    </dependency>

slf4j
slf4j
聚甲醛
这是我的外部POM:

<dependencies>
<dependency>
  <groupId>slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.7.0</version>
  <type>jar</type>
</dependency>
<dependency>
  <groupId>slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.7.0</version>
  <type>jar</type>
</dependency>

slf4j
slf4j api
1.7.0
罐子
slf4j
slf4j-log4j12
1.7.0
罐子

这是my assembly.xml:

<dependencySets>
    <dependencySet>
        <outputDirectory>output dir</outputDirectory>
        <includes>

            <include>apache:commons-configuration</include>
            <include>apache:commons-logging</include>
            <include>apache:commons-lang</include>
            <include>org.perf4j:perf4j</include>

            **Here I want to add slf4j-api and slf4j-log4j12 from external pom**
        </includes>
        <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
        <useStrictFiltering>true</useStrictFiltering>
        <useTransitiveDependencies>false</useTransitiveDependencies>
        <useProjectArtifact>false</useProjectArtifact>
        <scope>runtime</scope>
    </dependencySet>
<dependencySets>
    <dependencySet>
        <outputDirectory>output dir</outputDirectory>
        <includes>

            <include>apache:commons-configuration</include>
            <include>apache:commons-logging</include>
            <include>apache:commons-lang</include>
            <include>org.perf4j:perf4j</include>

            **Here I want to add slf4j-api and slf4j-log4j12 from external pom**
        </includes>
        <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
        <useStrictFiltering>true</useStrictFiltering>
        <useTransitiveDependencies>false</useTransitiveDependencies>
        <useProjectArtifact>false</useProjectArtifact>
        <scope>runtime</scope>
    </dependencySet>

输出目录
apache:commons配置
apache:commons日志
阿帕奇:公地郎
org.perf4j:perf4j
**这里我想从外部pom添加slf4j api和slf4j-log4j12**
${artifact.artifactId}.${artifact.extension}
真的
假的
假的
运行时

这是主要的pom:

    <dependency>
        <groupId>slf4j</groupId>
        <artifactId>slf4j</artifactId>
        <type>pom</type>
    </dependency>

slf4j
slf4j
聚甲醛
这是外部pom:

<dependencies>
<dependency>
  <groupId>slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.7.0</version>
  <type>jar</type>
</dependency>
<dependency>
  <groupId>slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.7.0</version>
  <type>jar</type>
</dependency>

slf4j
slf4j api
1.7.0
罐子
slf4j
slf4j-log4j12
1.7.0
罐子

这是assembly.xml:

<dependencySets>
    <dependencySet>
        <outputDirectory>output dir</outputDirectory>
        <includes>

            <include>apache:commons-configuration</include>
            <include>apache:commons-logging</include>
            <include>apache:commons-lang</include>
            <include>org.perf4j:perf4j</include>

            **Here I want to add slf4j-api and slf4j-log4j12 from external pom**
        </includes>
        <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
        <useStrictFiltering>true</useStrictFiltering>
        <useTransitiveDependencies>false</useTransitiveDependencies>
        <useProjectArtifact>false</useProjectArtifact>
        <scope>runtime</scope>
    </dependencySet>
<dependencySets>
    <dependencySet>
        <outputDirectory>output dir</outputDirectory>
        <includes>

            <include>apache:commons-configuration</include>
            <include>apache:commons-logging</include>
            <include>apache:commons-lang</include>
            <include>org.perf4j:perf4j</include>

            **Here I want to add slf4j-api and slf4j-log4j12 from external pom**
        </includes>
        <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
        <useStrictFiltering>true</useStrictFiltering>
        <useTransitiveDependencies>false</useTransitiveDependencies>
        <useProjectArtifact>false</useProjectArtifact>
        <scope>runtime</scope>
    </dependencySet>

输出目录
apache:commons配置
apache:commons日志
阿帕奇:公地郎
org.perf4j:perf4j
**这里我想从外部pom添加slf4j api和slf4j-log4j12**
${artifact.artifactId}.${artifact.extension}
真的
假的
假的
运行时

useTransitiveDependencies
应在my
dependencySet
中设置为“true”而不是“false”