global plugins don't get loaded automatically #272

Closed
eed3si9n opened this Issue Nov 20, 2011 · 8 comments

Projects

None yet

3 participants

@eed3si9n
Member

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 Nov 22, 2011
@harrah
Member
harrah commented Nov 22, 2011

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
Member

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

@harrah
Member
harrah commented Nov 22, 2011

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
Member

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
Member

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
Member
harrah commented Nov 22, 2011

Right, see my reply to Johannes.

@indrajitr indrajitr pushed a commit to indrajitr/xsbt that referenced this issue Nov 26, 2011
@harrah harrah show deprecation message for project/plugins/. fixes #272. 9d6c926
@eed3si9n
Member
eed3si9n commented May 9, 2012

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 Jun 3, 2012
@harrah
Member
harrah commented Jun 3, 2012

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

@harrah harrah added a commit that closed this issue Feb 1, 2013
@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 Feb 1, 2013
@harrah harrah was assigned Feb 2, 2013
@harrah harrah added a commit that referenced this issue Mar 6, 2013
@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 added a commit to dansanduleac/sbt that referenced this issue May 19, 2014
@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 added a commit to dansanduleac/sbt that referenced this issue May 28, 2014
@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