我正在尝试使用ivy-maven-plugin从另一个使用 Maven 构建的 Scala 程序执行 SBT 启动器。(旁注:我不是在寻找类似的答案:使用 SBT ......)
我的 ivyconf.xml 看起来像这样:
<ivysettings>
<property name='ivy.checksums' value=''/>
<resolvers>
<url name='typesafe-repo' alwaysCheckExactRevision='yes' checkmodified='true'>
<ivy pattern='http://repo.typesafe.com/typesafe/releases/[organization]/[module]/[revision]/ivys/ivy.xml'/>
<artifact pattern='http://repo.typesafe.com/typesafe/releases/[organization]/[module]/[revision]/jars/[artifact](.[ext])'/>
</url>
<ibiblio name="maven2-repo" m2compatible="true"/>
</resolvers>
<modules>
<module organisation='com.jcraft' matcher='regexp' resolver='maven2-repo'/>
<module organisation='jline' matcher='regexp' resolver='maven2-repo'/>
<module organisation='org.apache.ivy' matcher='regexp' resolver='maven2-repo'/>
<module organisation='org.scalacheck' matcher='regexp' resolver='maven2-repo'/>
<module organisation='org.scala-lang' matcher='regexp' resolver='maven2-repo'/>
<module organisation='org.scala-sbt' name='test-interface' matcher='regexp' resolver='maven2-repo'/>
<module organisation='org.scala-sbt' matcher='regexp' resolver='typesafe-repo'/>
<module organisation='org.scala-tools.sbinary' matcher='regexp' resolver='typesafe-repo'/>
<module organisation='org.scala-tools.testing' matcher='regexp' resolver='maven2-repo'/>
<module organisation='org.sonatype.oss' matcher='regexp' resolver='maven2-repo'/>
<module organisation='org.specs2' matcher='regexp' resolver='maven2-repo'/>
</modules>
</ivysettings>
Maven 插件定义如下:
<plugin>
<groupId>com.github.goldin</groupId>
<artifactId>ivy-maven-plugin</artifactId>
<version>0.2.5</version>
<executions>
<execution>
<id>add-idea-artifacts-compile-scope</id>
<goals>
<goal>ivy</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<ivyconf>${project.basedir}/src/main/resources/ivyconf.xml</ivyconf>
<scope>compile</scope>
<dependencies>
<dependency>
<groupId>ivy.org.scala-sbt</groupId>
<artifactId>launcher</artifactId>
<version>0.13.0-RC4</version>
<!--<classifier>???</classifier>-->
</dependency>
</dependencies>
</configuration>
</execution>
</executions>
</plugin>
当我执行构建时,我得到:
[ERROR] Failed to execute goal com.github.goldin:ivy-maven-plugin:0.2.5:ivy
(add-idea-artifacts-compile-scope) on project escalante-play:
Execution add-idea-artifacts-compile-scope of goal com.github.goldin:ivy-maven-plugin:0.2.5:ivy failed:
Multiple artifacts resolved for [org.scala-sbt:launcher:0.13.0-RC4:jar] -
[ivy.org.scala-sbt:launcher:jar:launcher:0.13.0-RC4:compile,
ivy.org.scala-sbt:launcher-interface:jar:launcher-interface:0.13.0-RC4:compile,
ivy.org.apache.ivy:ivy:jar:ivy:2.3.0-rc1:compile,
ivy.org.scala-sbt:io:jar:io:0.13.0-RC4:compile,
ivy.org.scala-sbt:control:jar:control:0.13.0-RC4:compile,
ivy.org.scalacheck:scalacheck_2.10:jar:scalacheck_2.10:1.10.0:compile,
ivy.org.scala-tools.testing:test-interface:jar:test-interface:0.5:compile,
ivy.org.scala-lang:scala-actors:jar:scala-actors:2.10.1:compile,
ivy.org.specs2:specs2_2.10:jar:specs2_2.10:1.12.3:compile,
ivy.org.specs2:specs2-scalaz-core_2.10.0-RC3:jar:specs2-scalaz-core_2.10.0-RC3:6.0.1:compile,
ivy.org.scala-lang:scala-reflect:jar:scala-reflect:2.10.2:compile,
ivy.org.scala-sbt:interface:jar:interface:0.13.0-RC4:compile],
specify <classifier> so that only one artifact is resolved. -> [Help 1]
我假设我需要使用 aclassified
但我真的不知道这个分类器真正应该包含什么。我试过launcher
但没有用,还有其他想法吗?
干杯,高尔德