scala 如何用sbt构建一个简单的war文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8701905/
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 03:46:47  来源:igfitidea点击:

How to build a simple war file with sbt?

scalaweb-applicationswarsbt

提问by user605331

I'm trying to make a webapp using Scala and Apache Wicket and am not sure how to structure my project and use SBT to build a war file. What directory structure should I use and how can I have SBT build the war file?

我正在尝试使用 Scala 和 Apache Wicket 制作一个 web 应用程序,但不确定如何构建我的项目并使用 SBT 来构建一个War文件。我应该使用什么目录结构以及如何让 SBT 构建War文件?

I'm new to SBT but my guess is there is an SBT plugin I need for this, but I'm not sure which to use.

我是 SBT 的新手,但我猜我需要一个 SBT 插件,但我不确定要使用哪个。

回答by pr1001

Checkout the web plugins. You'll probably want xsbt-web-plugin.

检查网络插件。您可能需要xsbt-web-plugin

回答by Janx

Here's a blog post I did detailing the changes in SBT 0.10.x in regards to web projects: http://janxspirit.blogspot.com/2011/06/scalatra-mongodb-template-project-using.html

这是我在 SBT 0.10.x 中关于 Web 项目的详细更改的博客文章:http://janxspirit.blogspot.com/2011/06/scalatra-mongodb-template-project-using.html

Most stuff is the same and the template project referenced in the post has been updated to 0.11.x Should help get you started with a simple web project with SBT. giter8 is a great tool for starting template projects.

大多数东西都是相同的,并且帖子中引用的模板项目已更新为 0.11.x 应该可以帮助您开始使用 SBT 进行简单的 Web 项目。Giter8 是启动模板项目的好工具。