Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publishing from sbt to a local maven repo

Tags:

maven

scala

sbt

I added the following to the build.sbt

publishTo := Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository")))

publishMavenStyle := true

Publishing does not seem to have been affected: the following

 sbt publishLocal

The result is apparently still going to the ivy instead of .m2 repo:

Packaging /git/msSCSCTEL/streaming-reconciler/target/scala-2.10/streaming-reconciler_2.10-0.1.0-SNAPSHOT-javadoc.jar ...
Done packaging.
    published streaming-reconciler_2.10 to /Users/myuser/.ivy2/local/com.mycomp/streaming-reconciler_2.10/0.1.0-SNAPSHOT/poms/streaming-reconciler_2.10.pom
    published streaming-reconciler_2.10 to /Users/myuser/.ivy2/local/com.mycomp/streaming-reconciler_2.10/0.1.0-SNAPSHOT/jars/streaming-reconciler_2.10.jar
    published streaming-reconciler_2.10 to /Users/myuser/.ivy2/local/com.mycomp/streaming-reconciler_2.10/0.1.0-SNAPSHOT/srcs/streaming-reconciler_2.10-sources.jar
    published streaming-reconciler_2.10 to /Users/myuser/.ivy2/local/com.mycomp/streaming-reconciler_2.10/0.1.0-SNAPSHOT/docs/streaming-reconciler_2.10-javadoc.jar
    published ivy to /Users/myuser/.ivy2/local/com.mycomp/streaming-reconciler_2.10/0.1.0-SNAPSHOT/ivys/ivy.xml

What is missing/incorrect to publish to maven instead?

like image 699
WestCoastProjects Avatar asked Jul 20 '16 14:07

WestCoastProjects


People also ask

What does sbt publish do?

The publish action is used to publish your project to a remote repository. To use publishing, you need to specify the repository to publish to and the credentials to use. Once these are set up, you can run publish .

What is ThisBuild in sbt?

Typically, if a key has no associated value in a more-specific scope, sbt will try to get a value from a more general scope, such as the ThisBuild scope. This feature allows you to set a value once in a more general scope, allowing multiple more-specific scopes to inherit the value.


1 Answers

Use publishM2. I've looked through the docs, but I can't find any reference to this command. I've discovered it simply by writing publish in the sbt console and then hitting the tab key a couple of times.

like image 142
Ionuț G. Stan Avatar answered Sep 24 '22 01:09

Ionuț G. Stan