3

I'm working on a Play Framework project and I wanted to add Maven compatibility. So I tried to add a plugin which understands pom.xml. Unfortunately this does not work.

I'm using sbt-maven-plugin with this line in my plugins.sbt:

addSbtPlugin("com.github.shivawu" % "sbt-maven-plugin" % "0.1.3-SNAPSHOT")

I also added the repository:

resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"

After reload command in Play console it gave this error:

enter image description here

Anyone an idea how to fix this? I'm using IntelliJ IDEA.

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
Wouter
  • 125
  • 1
  • 9

1 Answers1

3

tl;dr Make sure you work with project/plugins.sbt, use https for the repository and that you're not behind a firewall that blocks access to the repo or configure proxy appropriately.

According to the the official documentation of the plugin you should be using the following instead:

addSbtPlugin("com.github.shivawu" % "sbt-maven-plugin" % "0.1.2")

It didn't work for me, either, and I had to add the following repository to resolvers in project/plugins.sbt:

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

The complete project/plugins.sbt becomes as follows:

addSbtPlugin("com.github.shivawu" % "sbt-maven-plugin" % "0.1.3-SNAPSHOT")

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

With the setup build worked fine:

[info] downloading https://oss.sonatype.org/content/repositories/snapshots/com/github/shivawu/sbt-maven-plugin_2.10_0.13/0.1.3-SNAPSHOT/sbt-maven-plugin-0.1.3-SNAPSHOT.jar ...
[info]  [SUCCESSFUL ] com.github.shivawu#sbt-maven-plugin;0.1.3-SNAPSHOT!sbt-maven-plugin.jar (1664ms)

What's interesting is that there's 0.2.0-SNAPSHOT version available, too, yet build.sbt of the project doesn't seem to show the version could've been possible since 0.1.3-SNAPSHOT is the next version being worked on.

Community
  • 1
  • 1
Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
  • I'm using this build.sbt: `name := "testbuildsbt" version := "0.1" crossScalaVersions := Seq("2.10.3") libraryDependencies += "org.apache.kafka" %% "kafka" % "0.9.0.0" ` and this `plugins.sbt` `addSbtPlugin("com.github.shivawu" % "sbt-maven-plugin" % "0.1.3-SNAPSHOT") resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"` and still it cannot find `sbt-maven-plugin` any ideas? – Jas Jan 28 '16 at 12:22