小编use*_*978的帖子

SBT解决方案因Ivy额外属性而失败

我正试图在SBT中使用Ivy额外属性.我有两个模块:foo-model和foo-api.对于他们两个我添加到build.sbt:

projectID <<= projectID { id =>
   id extra("branch" -> "master-api-model-separation")
}
Run Code Online (Sandbox Code Playgroud)

Foo模型正在发布到Artifactory(使用sbt发布).已发布的POM文件如下所示:

<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.foo</groupId>
    <artifactId>foo-model</artifactId>
    <packaging>jar</packaging>
    <description>foo-model</description>
    <version>1.0</version>
    <name>foo-model</name>
    <organization>
        <name>com.foo</name>
    </organization>
    <properties>
        <branch>master-api-model-separation</branch>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.10.3</version>
        </dependency>
        ...
Run Code Online (Sandbox Code Playgroud)

然后我需要foo-api来使用foo-model,所以我把它添加到它的build.sbt:

def appDependencies = Seq(
    "com.foo"%"foo-model"%"1.0" extra( "branch" -> "master-api-model-separation" ) changing(),
    ...
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试运行SBT(更新或包)时,我得到了这个:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.foo#foo-model;1.0: java.text.ParseException: inconsistent module descriptor file found in 'http://xdctest-app-01:8081/artifactory/foo-master/com/foo/foo-model/1.0/foo-model-1.0.pom': bad branch found …
Run Code Online (Sandbox Code Playgroud)

sbt

9
推荐指数
1
解决办法
702
查看次数

标签 统计

sbt ×1