• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

sbt/sbt-pom-reader: Translates xml -> awesome. Maven-ish support for sbt. ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

sbt/sbt-pom-reader

开源软件地址(OpenSource Url):

https://github.com/sbt/sbt-pom-reader

开源编程语言(OpenSource Language):

Scala 94.5%

开源软件介绍(OpenSource Introduction):

sbt pom reader plugin

Build Status GitHub tag (latest by date)

This project aims to read Maven pom.xml files and configure a basic sbt project appropriately. We have limited aims:

  1. The intent is not to parse/use Maven plugins. The purpose is to translate project structure, dependencies, and artifact resolution
  2. Failure to read a pom.xml file causes the Maven build to crash
  3. Unexpected Maven-y things will simply fail to translate
  4. Majority of simple Maven projects will be usable directly in sbt from the Maven pom.xml

That said:

  1. Parent pom resolution and inheritance should work
  2. Multi-module builds should work, assuming each module meets the above caveats

Usage

You want you project directory to look like the following:

<my-maven-project>/
  pom.xml                  <- Your maven build.
  project/
     build.properties      <- the sbt version specification
     build.scala           <- the sbt build definition
     plugins.sbt           <- the sbt plugin configuration

  ..                       <- Whatever files are normally in your maven project.

Each of the files should have the following contents.

project/build.properties:

sbt.version=1.5.5

project/build.scala:

import sbt._
object MyBuild extends com.typesafe.sbt.pom.PomBuild

project/plugins.sbt:

 addSbtPlugin("com.typesafe.sbt" % "sbt-pom-reader" % "x.y.z")

Configuring projects

If the pom-reader plugin doesn't have a 100% mapping from your maven build into sbt (i.e. there is some kind of configuration you wish to perform, then you will need to add specific configuration items. Since the plugin is automatically generating the sub-projects based on your maven configuration, you'll have to indirectly reference them in sbt settings, like so:

build.sbt:

// This is a heuristic, assuming we're running sbt in the same directory as the build.
val buildLocation = (file(".").getAbsoluteFile.getParentFile)

// Here we define a reference to a subproject.  The string "subproject" refers to the artifact id of
// the subproject.
val subproject = ProjectRef(buildLoc, "subproject")

// Disable all scalac arguments when running the REPL.
scalacOptions in subproject in Compile in console := Seq.empty

Contributing

Please feel free to contribute example/test maven projects you'd like to be able to load in sbt.

Licensing

Apache 2 software license. See LICENSE.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
pallet/zi: Maven plugin for clojure发布时间:2022-08-17
下一篇:
Volminger/github-action-maven-example-start发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap