Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

global plugins don't get loaded automatically #272

Closed
eed3si9n opened this Issue · 8 comments

3 participants

@eed3si9n
Owner

steps

  1. add addSbtPlugin("com.eed3si9n" % "sbt-inspectr" % "X.X.X") to ~/.sbt/plugins/build.sbt.
  2. open an existing build using sbt 0.11.1.

also see https://gist.github.com/4682495

problem

the global plugin sbt-inspectr is not loaded automatically.

Doing the following fixes it:

> reload plugin
> clean
> reload return

expectation

the plugin gets loaded automatically.

@harrah harrah closed this in b07bd3a
@harrah
Owner

I'm not sure if this is actually the cause, but project/plugins/ has been deprecated since 0.11.0 in favor of the new approach, which fixes things like this. I added a warning so this deprecation is more widely known.

http://implicit.ly/simple-build-tool-0110

https://github.com/harrah/xsbt/wiki/Changes

@jrudolph

So, what does that mean for global plugins? How is this issue solved by that warning?

@harrah
Owner

project/plugins/ as implemented in 0.10.x tried to use global plugins as a binary dependency, but this was problematic. This was fixed in 0.11.0 by making the global plugins project a source dependency of the plugin definition. This was a fairly invasive change and I didn't want to make it automatic. It turned out that the plugins/ directory was no longer needed and its contents could now go directly in project/, simplifying things.

So, to allow users to transition smoothly, the old behavior was kept around and used if the project/plugins/ directory exists and the new (corrected) way gets used if no plugins/ directory exists. The change was documented, but the warning message makes it more obvious that an old, deprecated way is being used.

@jrudolph

Aha, so if your global plugins aren't updating/working any more, it may come from a project/plugins directory still lying around in your project, right?

I'll keep my eyes open to see if this is the only cause of the plugin problems I had.

@eed3si9n
Owner

To clarify, I am talking about global plugins in ~/.sbt/plugins/build.sbt, so I'm not sure why project/plugins/build.sbt -> project/plugins.sbt change is relevant.

Last I checked it still is:

~/.sbt/plugins/build.sbt.

@harrah
Owner

Right, see my reply to Johannes.

@eed3si9n
Owner

I am still seeing this behavior with sbt 0.11.3. When sbt project does not detect that global plugins were added, and I have to explicitly do reload plugins and clean.

The build definition uses project/plugins.sbt to list the plugins, and the global plugins are listed in ~/.sbt/0.11.3/plugins/plugins.sbt.

@harrah harrah reopened this
@harrah
Owner

Ok, I will look into it, but probably not in time for 0.12.0.

@harrah harrah closed this issue from a commit
@harrah harrah Load global plugins in their own class loader and replace the base lo…
…ader with that. Fixes #272.

Also, replace the base classpath with the global classpath.
8cb7e23
@harrah harrah closed this in 8cb7e23
@harrah harrah was assigned
@harrah harrah referenced this issue from a commit
@harrah harrah Load global plugins in their own class loader and replace the base lo…
…ader with that. Fixes #272.

Also, replace the base classpath with the global classpath.
3fccd4c
@dansanduleac dansanduleac referenced this issue from a commit in dansanduleac/sbt
@dansanduleac dansanduleac Revert "Load global plugins in their own class loader and replace the…
… base loader with that. Fixes #272."

This reverts commit 8cb7e23.

Conflicts:
	main/src/main/scala/sbt/Load.scala
a767011
@dansanduleac dansanduleac referenced this issue from a commit in dansanduleac/sbt
@dansanduleac dansanduleac Revert "Load global plugins in their own class loader and replace the…
… base loader with that. Fixes #272."

This reverts commit 8cb7e23.

Conflicts:
	main/src/main/scala/sbt/Load.scala
87e9250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.