你如何删除_<scala-version>来自使用 simple-build-tool 构建+发布的工件的后缀? [英] How do you remove the _<scala-version> postfix from artifacts built+published with simple-build-tool?

查看:24
本文介绍了你如何删除_<scala-version>来自使用 simple-build-tool 构建+发布的工件的后缀?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 simple-build-tool 构建一些仅限 Java 的项目.当我使用 sbt publish-local 从项目中发布工件时,生成的工件会将 Scala 版本附加到它们的名称中.对于 Scala 项目,这是有道理的,但由于这些只是 Java 项目,因此没有意义.我将如何禁用 Scala 版本的这个后缀?或者我可以吗?

I'm building a few Java-only projects using simple-build-tool. When I publish the artifacts from the projects using, say, sbt publish-local then the resulting artifacts have the Scala version appended to their name. With a Scala project this would make sense, but since these are Java only projects it doesn't. How would I disable this postfixing of the Scala version? Or can I?

作为参考,我使用 sbt 0.11.1、Scala 2.9.1 和 .sbt 文件进行构建配置(尽管迁移到完整的项目配置没有问题).

For reference I'm using sbt 0.11.1, Scala 2.9.1 and a .sbt file for build configuration (though moving to a full project config would be no problem).

推荐答案

在查看 Artifact.artifactName 是如何实现并最终使用之后,似乎关闭它的方法是为 crossPath 设置指定 false.这在 xsbt wiki 上的一个快速配置示例中有记录.

After looking around how Artifact.artifactName is implemented and ultimately used it seems that the way to turn this off is to specify false for the crossPath setting. This is documented in one of the quick configuration examples on the xsbt wiki.

http://www.scala-sbt.org/发布/文档/示例/快速配置示例

// disable using the Scala version in output paths and artifacts
crossPaths := false

这篇关于你如何删除_<scala-version>来自使用 simple-build-tool 构建+发布的工件的后缀?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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