scala SBT 到 Maven 转换器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5067501/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 02:51:21  来源:igfitidea点击:

SBT to Maven Converter

scalamavensbt

提问by Sawyer

Since most IDEs are only able to import Maven projects, I'd like to generate a POM.xml from an SBT managed project, is there a better way to do it?

由于大多数 IDE 只能导入 Maven 项目,我想从 SBT 管理的项目生成 POM.xml,有没有更好的方法来做到这一点?

回答by Vasil Remeniuk

Did you try make-pomfrom sbt?

make-pomsbt尝试吗?

It generates basic POM for the current project at the ./target. To customize generation, you can override pomExtra, pomIncludeRepositoryand pomPostProcessat the project definition.

它在./target为当前项目生成基本 POM 。要自定义生成,您可以在项目定义处覆盖pomExtra,pomIncludeRepositorypomPostProcess

回答by James Iry

Vasil's answer is correct, but for Eclipse and IDEA you can generate IDE metadata more directly using plugins. For IDEA https://github.com/mpeltonen/sbt-idea, and for Eclipse https://github.com/musk/SbtEclipsify.

Vasil 的回答是正确的,但对于 Eclipse 和 IDEA,您可以使用插件更直接地生成 IDE 元数据。对于 IDEA https://github.com/mpeltonen/sbt-idea,对于 Eclipse https://github.com/musk/SbtEclipsify

回答by Amit khandelwal

There is a very direct way provided by SBT. You can use the below command where your SBT file exixts:

SBT提供了一种非常直接的方式。您可以在 SBT 文件存在的位置使用以下命令:

sbt makePom

sbt makePom

This will generate the .pom file in the target folder you can search that and rename to pom.xml and keep that file in the location and run mvn clean compile installto get full out of it.

这将在目标文件夹中生成 .pom 文件,您可以搜索该文件并将其重命名为 pom.xml 并将该文件保留在该位置并运行mvn clean compile install以完全摆脱它。