Question

I'm just starting with Scala and the TypeSafe stack and I've decided to start my experiments with Typesafe Activator. I'm working on a project that is intended to be a figurative followup to Hello World that will allow me to learn how to work with the tools in a slightly more real world scenario.

For the purposes of this question, my plan is to create a few simple projects and have them reference one another. I created the first project and tried to publish it to the local Ivy repository using the publishLocal command in the activator/sbt command line tool. When I do so, I get the an error indicating that the resolver 'local' is not defined, see below (note that the error output was edited slightly; I change the path to xxxxx):

> publishLocal
[info] Packaging /Users/xxxxx/target/scala-2.10/recipedocs_2.10-1.0-sources.jar ...
[info] Updating {file:/Users/xxxxx/}recipedocs...
[info] Done packaging.
[info] Wrote /Users/xxxxx/target/scala-2.10/recipedocs_2.10-1.0.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] :: delivering :: recipedocs#recipedocs_2.10;1.0 :: 1.0 :: release :: Fri Dec 20 11:32:27 EST 2013
[info]  delivering ivy file to /Users/xxxxx/target/scala-2.10/ivy-1.0.xml
[info] Main Scala API documentation to /Users/xxxxx/target/scala-   2.10/api...
[info] Packaging /Users/xxxxx/target/scala-2.10/recipedocs_2.10-1.0.jar ...
[info] Done packaging.
model contains 2 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /Users/xxxxx/target/scala-2.10/recipedocs_2.10-1.0-javadoc.jar ...
[info] Done packaging.
[trace] Stack trace suppressed: run last *:publishLocal for the full output.
[error] (*:publishLocal) Undefined resolver 'local'
[error] Total time: 1 s, completed Dec 20, 2013 11:32:28 AM

The first time this occurred, I had been working on the project for a while before attempting to publish. I'm pretty sure I never touched any configuration that would mess up sbt, but to confirm, I repeated the process with a new project created with the Typesafe Activator, as follows:

  1. Use whichever version of TypeSafe Activator was the current version as of around Dec. 1, 2013
  2. Use their browser based tool to create a new project based on the Hello World scala template.
  3. Save the new project to some location other than their default location
  4. In a command line shell (in my case, Terminal, as this was done on a Mac) cd to the project location
  5. Start Activator
  6. Issue the publishLocal command
  7. See output similar to the above.

The results, using a new clean project that was created by the activator, are the same as shown above.

I have come up with a work around. I added the following publishTo declaration in the sbt.build file:

publishTo := Some(Resolver.defaultLocal)

and I have successfully used the publish command instead of publishLocal.

But that is a hack, as the documentation indicates that publishLocal should publish to the local ivy repository by default. Note that the Ivy repository had already been created, by sbt/activator as that is where it is storing cached copies of the libraryDependencies. It appears that, at least for the purposes of managing dependencies, sbt/activator is accessing the correct location; it's just for publishLocal that there are problems.

One other item that may or may not be relevant. Again, when starting from the clean project that activator created from the Hello World scala template. When activator is started it warns about multiple resolvers, like so:

$ ./activator
[info] Loading project definition from /Users/xxxxx/project
[warn] Multiple resolvers having different access mechanism configured with same name 'typesafe-ivy-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`). 

I suspect a configuration issue, but I'm new to this stack. Note that these problems are for Ivy, not Maven. I haven't tried it with Maven. I've seen discussions about sbt and the local Maven repository, but they don't appear relevant to my issues with Ivy.

So, finally, the question - What do I need to do to create a project with the Typesafe Activator that will publish to the local Ivy repository using publishLocal in the activator/sbt command line tool?

Thanks

Was it helpful?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top