在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):zen0wu/sbt-maven-plugin开源软件地址(OpenSource Url):https://github.com/zen0wu/sbt-maven-plugin开源编程语言(OpenSource Language):Scala 100.0%开源软件介绍(OpenSource Introduction):sbt-maven-pluginYoho! Finally, a SBT plugin for Maven You should fall in love with it
Why made this?Maven is great stuff, while its choice of XML as its descriptor doomed that it's not good at describing behaviors. Maven's solution is using plugins. Maven has so many plugins. As more expressive language coming on stage, like Groovy or Scala, programmers can use predefined DSL to better define behaviors. By using the neat DSLs which Gradle or SBT provides, we can easily implement build system tasks. How about, I myself, wrote this plugin because Intelij IDEA has great Maven support, while plugins for others(Gradle, SBT) are all 3rd-party. And let's be honest, they suck. If you're using SBT with IDEA, you have to reload the project, whenever your project definition changes, but with Maven, it's just a fast update. By using this plugin, you can just update your dependencies(or whatever) in UsageConfigurationAdd the following to addSbtPlugin("com.github.shivawu" % "sbt-maven-plugin" % "0.1.2") Or go the hard way, add the following code to import sbt._
import Keys._
object Plugins extends Build {
lazy val root = Project("root", file(".")).settings(
addSbtPlugin("com.github.shivawu" % "sbt-maven-plugin" % "0.1.2")
)
} Single module projectSee the configuration section above? Do that, and done. Just make sure there's a I assume that if you're using this plugin, you will assure that This is achieved by override the This default behavior will be disabled only when there is module definition in Multi module projectDue to import com.github.shivawu.sbt.maven.MavenBuild // Sorry for the long package name :-(
object MyBuild extends MavenBuild {
// "*" is a selector which selects all modules
project("*")(
// Note that these properties like compile source, target, encoding
// are treated as common properties. So set a pom.xml property
// like "<maven.compiler.source>1.6</maven.compiler.source>" also works.
javacOptions ++= Seq("-source", "1.6")
)
// Here "a" is a project id, which is set to the artifactId
// BUT! SBT doesn't allow "." in the id, so the "." is replaced with "_"
project("a") (
// Project specific settings here
)
// Note that you can select multiple(but not all) modules using the "|" operator
project("b" | "c") (
assemblySettings ++ Seq(
test in assembly := {}
)
:_*) // Finally convert it to a Setting[_]*
} Features
LicensesCopyright 2012 Shiva Wu Licensed under Apache License, Version 2.0. You may obtain a copy of the license in the LICENSE file, or at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论