Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`updateSbtClassifiers` tried wrong bintray doc and src address. #3432

Closed
cuzfrog opened this issue Aug 14, 2017 · 12 comments

Comments

Projects
None yet
8 participants
@cuzfrog
Copy link

commented Aug 14, 2017

(See the guidelines for contributing, linked above)

steps

Use IDEA refresh project via sbt-shell with "Download sbt and plugin src and doc" checked.

problem

IDEA executed updateSbtClassifiers and failed to download src and doc because of wrong uri:

https://dl.bintray.com/cuzfrog/maven/com/github/cuzfrog/sbt-tmpfs_2.12_1.0/0.3.0/sbt-tmpfs-0.3.0-sources.jar

and it did not try

https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.github.cuzfrog/sbt-tmpfs/scala_2.12/sbt_1.0//0.3.0/docs/sbt-tmpfs-javadoc.jar

notes

use reload plugins then updateClassifiers worked around this.

sbt version: 1.0.0

@cuzfrog cuzfrog closed this Aug 30, 2017

@OlegYch

This comment has been minimized.

Copy link
Contributor

commented Oct 23, 2017

@cuzfrog why did you close this, seems to be still a problem
fails intellij import for me on 1.0.2

@OlegYch

This comment has been minimized.

Copy link
Contributor

commented Oct 23, 2017

here is my log https://pastebin.com/F1TdyNym
note that for some reason updateSbtClassifiers tries resolvers defined for the project, not for the plugins project

@OlegYch

This comment has been minimized.

Copy link
Contributor

commented Dec 18, 2017

still an issue in 1.0.4

@dwickern

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2017

You can reproduce this by importing alpakka (which uses sbt 1.0.4) into IntelliJ with the "download sources/javadoc" options checked.

One workaround is to uncheck the "download sources/javadoc" options, but then you won't have any sources or javadocs!

Another workaround is to create project/FixIntellijImport.scala:

object FixIntellijImport extends AutoPlugin {
  override def trigger = allRequirements
  override def projectSettings = Seq(
    updateConfiguration in updateSbtClassifiers := (updateConfiguration in updateSbtClassifiers).value.withMissingOk(true)
  )
}

Then remove it after the project is imported.

@OlegYch

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2017

@dwickern a simpler and more complete workaround would be to do ;reload plugins; updateClassifiers; reload return
perhaps updateSbtClassifiers should be changed to do just that

@michaelahlers

This comment has been minimized.

Copy link

commented Jan 9, 2018

Ran into this as well. Used workaround documented at sbt/sbt-native-packager#1063.

@steinybot

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2018

This is still an issue in 1.1.1.

The ;reload plugins; updateClassifiers; reload return does download a lot more things it does not seem to download the sources for the plugin even though they are shown in libraryDependencies of the meta build.

updateConfiguration in updateSbtClassifiers := (updateConfiguration in updateSbtClassifiers).value.withMissingOk(true) also does not fix it for me.

What partially worked was to use ;set every sbtPlugin := true;updateSbtClassifiers;reload. This then downloaded the sources (however IntelliJ still does not attach them).

@steinybot

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2018

The problem appears to be that the updateSbtClassifiers task depends on updateSbtClassifiers / dependencyResolution but this is provided by dependencyResolution without a task axis. This dependencyResolution uses ivyConfiguration which also has no task axis.

The solution is to scope dependencyResolution correctly:

updateSbtClassifiers / dependencyResolution := IvyDependencyResolution((updateSbtClassifiers / ivyConfiguration).value)
@OlegYch

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2018

@steinybot this seems to work, can you make a pr?

@steinybot

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2018

@OlegYch Yeah sure.

@therealpxc

This comment has been minimized.

Copy link

commented Apr 5, 2018

I've run into this issue with ENSIME. It doesn't cause a real failure, maybe because ENSIME is already set up to ignore missing items when it runs updateClassifiers or whatever (I haven't looked into the internals).

Inserting reload plugins into my big fat SBT command has fixed it:

sbt '; clean ; compile ; test:compile ; *reload plugins* ; ensimeConfig ; ensimeConfigProject'   

grabs all the expected src and doc JARs. I suppose this will happily be of limited usefulness soon, since we're getting an upstream fix, but I thought I'd document the workaround here regardless.

@dwijnand

This comment has been minimized.

Copy link
Member

commented Apr 6, 2018

fixed in #4070, coming in sbt 1.1.3.

@dwijnand dwijnand closed this Apr 6, 2018

steinybot added a commit to steinybot/sbt that referenced this issue Jun 4, 2018

steinybot added a commit to steinybot/sbt that referenced this issue Jun 21, 2018

steinybot added a commit to steinybot/sbt that referenced this issue Jun 25, 2018

steinybot added a commit to steinybot/sbt that referenced this issue Jun 25, 2018

@steinybot steinybot referenced this issue Jun 27, 2018

Merged

Add warning for unknown configurations #4231

1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.