问题
Is there anyway to use a maven plugin on SBT?
回答1:
No. sbt does support pom.xml in limited way via sbt-pom-reader, but we do not support the use of maven plugins. It has its own plugin ecosystem, so maybe you could find similar one that does the job.
If you need to pull in Maven plugin as a library, you would need this setting:
classpathTypes += "maven-plugin"
回答2:
A maven plugin is a jar
file, but with packaging maven-plugin
, not jar
as it would be usual. But, apparently, SBT does not like it or does not find it, for some reason. Try forcing the URL, like this:
libraryDependencies ++=
Seq (
"com.example" % "myartifact" % "1.59" from
"http://server:8081/artifactory/plugins-release-local/" +
"com/example/myartifact/1.59/myartifact-1.59.jar" )
From my experience, classpathTypes += "maven-plugin"
seems not to be necessary but I guess it might be in case the resource you are downloading is not a .jar
or other file extensions SBT knows that should participate in the CLASSPATH.
来源:https://stackoverflow.com/questions/5556408/use-maven-plugin-on-sbt