Use maven plugin on SBT

帅比萌擦擦* 提交于 2019-12-21 05:04:04

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!