Maven 工件 jar 名称与版本不同 [英] Maven artifact jar different name than version

查看:71
本文介绍了Maven 工件 jar 名称与版本不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于 Maven 的小问题.我有一个项目我的 pom.xml

I got a small question about Maven. I got a project my pom.xml

它基本上有这个存储库:

It has basically this repositories:

<repositories>
    <repository>
        <id>alfresco-mirror</id>
        <name>Alfresco Public Mirror</name> 
        <url>http://maven.alfresco.com/nexus/content/groups/public</url>
    </repository>
    <repository>
        <id>alfresco-snapshots</id>
        <name>Alfresco Public Snapshots</name>
        <url>http://maven.alfresco.com/nexus/content/groups/public-snapshots</url>
        <snapshots>
            <updatePolicy>always</updatePolicy>
        </snapshots>    
    </repository>
    <repository>
        <id>alfresco</id>
        <name>Alfresco Public </name>
        <url>http://pipin.bluexml.com/nexus/content/repositories/thirdparty/</url>
        <snapshots>
            <updatePolicy>always</updatePolicy>
        </snapshots>    
    </repository>
</repositories>

和这个依赖:

<dependencies>
       <dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-web-service-client</artifactId>
        <version>3.4.d</version>
        <type>jar</type>
    </dependency>  
</dependencies>

我认为主要问题是 jar 文件和版本的名称不同.我该如何解决这个问题?

I think the main problem is that jar file and version got different names. How can I solve this?

我提前感谢您的帮助.

PS:为了节省时间,这个依赖链接位置

推荐答案

尝试添加分类器节点,看看是否有效:

Try adding a classifier node to see if that works:

<dependencies>
  <dependency>
    <groupId>org.alfresco</groupId>
    <artifactId>alfresco-web-service-client</artifactId>
    <version>3.4.d</version>
    <classifier>community</classifier>
    <type>jar</type>
  </dependency>  
</dependencies>

您可以在此处了解其背后的原因.长话短说,分类器只是在版本号之后附加到该工件名称.它们并不经常使用,但您确实会不时看到它们.

You can see the reasoning behind that here. Long story short, classifiers are just appended to that artifact name right after the version number. They're not used all that often, but you do see them from time to time.

这篇关于Maven 工件 jar 名称与版本不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆