Wouter
Wouter

Reputation: 125

Is there an online repository with sbt-maven-plugin?

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.

Upvotes: 3

Views: 1165

Answers (1)

Jacek Laskowski
Jacek Laskowski

Reputation: 74709

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.

Upvotes: 3

Related Questions