包含错误名称的maven依赖项

时间:2014-09-16 15:20:42

标签: java maven dependencies zip

我想将工件my_groupid:my_artifact:1.1包含到我的项目中,但它在maven存储库中名称错误。存储库结构是:

my_groupid
    my_artifact
        1.1
            my_artifact-1.1-config.jar
            my_artifact-1.1-config.jar.md5
            my_artifact-1.1-config.jar.sha1
            my_artifact-1.1.pom
            my_artifact-1.1.pom.md5
            my_artifact-1.1.pom.sha1

my_artifact-1.1.pom conatins:

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>my_groupid</groupId>
        <artifactId>my_artifact</artifactId>
        <packaging>pom</packaging>
        <version>1.1</version>
        <dependencies/>
</project>

工件my_artifact-1.1-config.jar在根目录中只包含两个XML文件,看起来像一个简单的zip。

我已尝试build-helper-maven-plugin Maven - Depend on assembled zip,但我无法指定类型zip。简单

    <dependency>
        <groupId>my_groupid</groupId>
        <artifactId>my_artifact</artifactId>
        <version>1.1</version>
        <type>jar</type>
    </dependency>
由于存储库中的工件名称错误,

无法正常工作。

如何包含此工件来访问我的XML?

1 个答案:

答案 0 :(得分:1)

我猜“配置”部分似乎是部署分类器。我将在依赖项设置中指定分类器字段:

<dependency>
        <groupId>my_groupid</groupId>
        <artifactId>my_artifact</artifactId>
        <version>1.1</version>
        <classifier>config</classifier>
</dependency>