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

publishM2 in sbt 0.13.2-M2 don't overwrite #1156

Closed
patriknw opened this issue Mar 7, 2014 · 31 comments
Closed

publishM2 in sbt 0.13.2-M2 don't overwrite #1156

patriknw opened this issue Mar 7, 2014 · 31 comments
Labels
Milestone

Comments

@patriknw
Copy link

patriknw commented Mar 7, 2014

Changed behaviour compared to 0.13.1.

See log from this pull request build

java.io.IOException: file copy not done from /localhome/jenkinsakka/workspace/pr-validator-per-commit/akka-persistence/target/akka-persistence-experimental_2.10-2.3-SNAPSHOT.pom to /localhome/jenkinsakka/.m2/repository/com/typesafe/akka/akka-persistence-experimental_2.10/2.3-SNAPSHOT/akka-persistence-experimental_2.10-2.3-SNAPSHOT.pom: destination already exists and overwrite is false
    at org.apache.ivy.plugins.repository.file.FileRepository.copy(FileRepository.java:78)
    at org.apache.ivy.plugins.repository.file.FileRepository.put(FileRepository.java:58)
    at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
    at org.apache.ivy.plugins.resolver.RepositoryResolver.put(RepositoryResolver.java:234)
    at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216)
    at sbt.IvyActions$$anonfun$publish$3.apply(IvyActions.scala:262)
    at sbt.IvyActions$$anonfun$publish$3.apply(IvyActions.scala:261)
    at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
    at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
    at sbt.IvyActions$.publish(IvyActions.scala:261)
    at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply$mcV$sp(IvyActions.scala:97)
    at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply(IvyActions.scala:97)
    at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply(IvyActions.scala:97)
    at sbt.IvyActions$.withChecksums(IvyActions.scala:106)
    at sbt.IvyActions$.sbt$IvyActions$$withChecksums(IvyActions.scala:101)
    at sbt.IvyActions$$anonfun$publish$1.apply(IvyActions.scala:97)
    at sbt.IvyActions$$anonfun$publish$1.apply(IvyActions.scala:91)
@jsuereth jsuereth added the Bug label Mar 7, 2014
@jsuereth jsuereth added this to the 0.13.2 milestone Mar 7, 2014
@jsuereth
Copy link
Member

jsuereth commented Mar 7, 2014

I've seen this randomnly show up in our unit tests. If you don't clean the ivy cache before running, it happens always on the second running. I'll dig in and see if I can get a fix. We're blocking the 0.13.2 release on this.

Thanks!

@jsuereth
Copy link
Member

jsuereth commented Mar 7, 2014

Huh, this appears to be a regression from 0199a93

It looks like isSnapshot isn't returning true legitimately. I'm investigating.

@jsuereth
Copy link
Member

jsuereth commented Mar 7, 2014

So there are two things at play here:

  1. a legitimate issue in Akka's build that's now "exposed" by turning on overwrite.
  2. the exception you linked which I can't reproduce (yet).

Basically, as of sbt 0.13.2 you can no longer republish a release if it already exists. This is quite a dangerous thing to do because it leads to broken caches all over. Only -SNAPSHOTs are allowed to be republished. In akka, there is a project akka-sample-main-scala which is not a SNAPSHOT and therefore should not be publishM2'd nightly.

We have a few things we can do:

  1. use default overwrite true for every artifact as we did before in sbt 0.13.{0,1}
  2. Improve the error message shown with an explanation.

jsuereth added a commit that referenced this issue Mar 8, 2014
Workaround for #1156.

* Creates a new FileRepository that will stil allow local files
  to be transfered if overwrite is true (non-snapshot module),
  but will issue a warning about deprecated behavior.
* Ensure warning is long enough to annoy people into asking
  what it's about.
jsuereth added a commit that referenced this issue Mar 8, 2014
Workaround for #1156.

* Creates a new FileRepository that will stil allow local files
  to be transfered if overwrite is true (non-snapshot module),
  but will issue a warning about deprecated behavior.
* Ensure warning is long enough to annoy people into asking
  what it's about.
@jsuereth
Copy link
Member

jsuereth commented Mar 8, 2014

I just pushed a workaround. After the nightly build, can you try against 0.13.2-SNAPSHOT?

@patriknw
Copy link
Author

patriknw commented Mar 9, 2014

I tried (locally) to use 0.13.2-20140309-062258, but then it can't resolve the plugins. Might be easier if you create another akka pull request based on mine, that you can tweak yourself to see how jenkins reacts. Thanks.

@patriknw
Copy link
Author

@jsuereth I was able to reproduce it locally by changing the location of the m2 repo with -Dakka.build.M2Dir=/Users/patrik/.m2/repository2, which is what we do in the jenkins job.
Same error with 0.13.2-M2 and it is fixed in 0.13.2-20140309-062258.
Thanks

@jsuereth
Copy link
Member

Great news. I need to look into that specifically though. Something is going on there which leads to the overwrite being true. If we remove that in sbt 1.0, we run back into the same issue.

jsuereth added a commit that referenced this issue Mar 10, 2014
We cannot break existing users, but we can deprecate the improper usage.
This is part #2 of the workaround for #1156.  This ensures that
users will stop using the legacy methods after 0.13.2 is out.
jsuereth added a commit to eed3si9n/sbt that referenced this issue Mar 21, 2014
Workaround for sbt#1156.

* Creates a new FileRepository that will stil allow local files
  to be transfered if overwrite is true (non-snapshot module),
  but will issue a warning about deprecated behavior.
* Ensure warning is long enough to annoy people into asking
  what it's about.
jsuereth added a commit to eed3si9n/sbt that referenced this issue Mar 21, 2014
We cannot break existing users, but we can deprecate the improper usage.
This is part #2 of the workaround for sbt#1156.  This ensures that
users will stop using the legacy methods after 0.13.2 is out.
@huntc
Copy link

huntc commented Apr 2, 2014

I don't know if this is related, but I just tried publishing a milestone of sbt-web and received the following:

java.io.IOException: destination file exists and overwrite == false
    at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:75)
    at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
    at org.apache.ivy.plugins.resolver.RepositoryResolver.putChecksum(RepositoryResolver.java:250)
    at org.apache.ivy.plugins.resolver.RepositoryResolver.put(RepositoryResolver.java:236)
    at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216)

...having issued an sbt-publish.

Here's my publish config:

publishTo := {
    val isSnapshot = version.value.contains("-SNAPSHOT")
    val typesafe = "http://private-repo.typesafe.com/typesafe/"
    val (name, url) = if (isSnapshot)
                        ("sbt-plugin-snapshots", typesafe + "maven-snapshots")
                      else
                        ("sbt-plugin-releases", typesafe + "maven-releases")
    Some(Resolver.url(name, new URL(url)))
}

I'm using sbt 0.13.5-M2.

I now also have these up on Artifactory; could you remove them? (note, not 1.0.0-M1!)

http://private-repo.typesafe.com/typesafe/maven-releases/com/typesafe/jse_2.10/1.0.0/
http://private-repo.typesafe.com/typesafe/maven-releases/com/typesafe/jse_2.10/1.0.0-M2/
http://private-repo.typesafe.com/typesafe/maven-releases/com/typesafe/jse_2.10/1.0.0-M2x/

@jsuereth
Copy link
Member

jsuereth commented Apr 2, 2014

What repository were you trying to publish to? We recently added the "overwrite" flag back into the system so if you try to publish a release overtop of a file you get a warning.

If this was for a non-local URL it's a related, but different bug. Please re-open this with a bit more info if that's the case.

@huntc
Copy link

huntc commented Apr 2, 2014

The repository was listed at the end there. :-) It's our typesafe Artifactory repo.

@huntc
Copy link

huntc commented Apr 2, 2014

I'm also unable to reopen the bug. Permissions.

@jsuereth jsuereth reopened this Apr 2, 2014
@jsuereth jsuereth modified the milestones: 0.13.5, 0.13.2 Apr 2, 2014
@jsuereth
Copy link
Member

jsuereth commented Apr 4, 2014

@huntc looks like sbt is publishing hte pom.xml file twice. The second time it fails....

@jsuereth
Copy link
Member

jsuereth commented Apr 4, 2014

SO, that's not the issue at all. The issue is that when we push checksums, Artifactory automatically creates them for us in the configuration of our repositories, so when Ivy goes to see if it exists, it does and then ivy pukes saying "can't overwrite".

I need to think about how to solve this.

@jsuereth
Copy link
Member

jsuereth commented Apr 4, 2014

@huntc - Your issue is actually mostly unrelated to this one (publishM2 vs. publish. I'm opening a different ticket than this to track the issue separately.

@jsuereth jsuereth closed this as completed Apr 4, 2014
@huntc
Copy link

huntc commented Apr 6, 2014

Thanks Josh. Can you please cite the other issue for my tracking purposes? Thanks.

@huntc
Copy link

huntc commented May 16, 2014

I couldn't find that other issue that you referred to. However I've just seen this on our Play CI server. We're using sbt 0.13.5-RC1:

[info]  published play-docs_2.11 to https://private-repo.typesafe.com/typesafe/maven-releases/com/typesafe/play/play-docs_2.11/2.4-2014-05-15-b4f8cc8/play-docs_2.11-2.4-2014-05-15-b4f8cc8.pom
[info]  published play-docs_2.11 to https://private-repo.typesafe.com/typesafe/maven-releases/com/typesafe/play/play-docs_2.11/2.4-2014-05-15-b4f8cc8/play-docs_2.11-2.4-2014-05-15-b4f8cc8.jar
[info]  published play-docs_2.11 to https://private-repo.typesafe.com/typesafe/maven-releases/com/typesafe/play/play-docs_2.11/2.4-2014-05-15-b4f8cc8/play-docs_2.11-2.4-2014-05-15-b4f8cc8-sources.jar
[info]  published play-docs_2.11 to https://private-repo.typesafe.com/typesafe/maven-releases/com/typesafe/play/play-docs_2.11/2.4-2014-05-15-b4f8cc8/play-docs_2.11-2.4-2014-05-15-b4f8cc8-tests-sources.jar
java.io.IOException: destination file exists and overwrite == false
    at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:75)
    at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)

The artifacts actually got uploaded ok.

Here's the CI that failed: https://playframework2.ci.cloudbees.com/job/play2-master-nightly-deploy/323/consoleFull Here's the repo with the published artifacts that ivy is complaining about: https://private-repo.typesafe.com/typesafe/maven-releases/com/typesafe/play/play-docs_2.11/2.4-2014-05-15-b4f8cc8/

@jsuereth
Copy link
Member

@huntc This is because artifactory is autogenerating the files we look for. What looks odd to me is that you should NOT be seeing that in 0.13.5-RC1.

Can you issue more of the stack trace so I can see the sbt-related code?

@huntc
Copy link

huntc commented May 16, 2014

@huntc
Copy link

huntc commented May 16, 2014

The build failed again so at least it is reproducible.

@jsuereth
Copy link
Member

@huntc Ok, oddly your issue is different. You're legitimately seeing the overwrite issue. However, since you're publishing a snapshot, you can correct this by having isSnapshot := true on your projects and it will stop issuing the error on overwrite.

@huntc
Copy link

huntc commented May 16, 2014

Hey Josh. We are not publishing a snapshot though...

@jsuereth
Copy link
Member

@huntc I realize that. isSnapshot, currently, only denotes that the build can overwrite previous values. I suspect +publish has something to do with your issues (republishing artifacts that shouldn't be republished)

duncancrawford pushed a commit to hmrc/sbt-settings that referenced this issue Jun 14, 2014
@dircsem
Copy link

dircsem commented Jul 8, 2014

I'm facing the same problem.
isSnapshot has solved it, although it is a temporary solution right?
Is there somebody working to solve this issue? Is there an overwrite parameter in sbt? If so how can I use it?

@matthughes
Copy link

Believe I'm having the same issue as @huntc . Using SBT 0.13.5-RC5.

These are snapshot builds and I took the same code he used to forcefully set isSnapshot, yet still getting the same error.

I double-checked 'isSnapshot' is set in consoleProject:
scala> (isSnapshot).eval
res0: Boolean = true

Here is the stack:

build   11-Jul-2014 12:10:09    java.io.IOException: destination file exists and overwrite == false
build   11-Jul-2014 12:10:09        at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:75)
build   11-Jul-2014 12:10:09        at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
build   11-Jul-2014 12:10:09        at sbt.ConvertResolver$ChecksumFriendlyURLResolver$class.put(ConvertResolver.scala:80)
build   11-Jul-2014 12:10:09        at sbt.ConvertResolver$PluginCapableResolver$1.put(ConvertResolver.scala:106)
build   11-Jul-2014 12:10:09        at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$$anonfun$publish$3.apply(IvyActions.scala:263)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$$anonfun$publish$3.apply(IvyActions.scala:262)
build   11-Jul-2014 12:10:09        at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
build   11-Jul-2014 12:10:09        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
build   11-Jul-2014 12:10:09        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
build   11-Jul-2014 12:10:09        at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$.publish(IvyActions.scala:262)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply$mcV$sp(IvyActions.scala:97)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply(IvyActions.scala:97)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply(IvyActions.scala:97)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$.withChecksums(IvyActions.scala:106)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$.sbt$IvyActions$$withChecksums(IvyActions.scala:101)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$$anonfun$publish$1.apply(IvyActions.scala:97)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$$anonfun$publish$1.apply(IvyActions.scala:91)
build   11-Jul-2014 12:10:09        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:115)
build   11-Jul-2014 12:10:09        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:115)
build   11-Jul-2014 12:10:09        at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:103)
build   11-Jul-2014 12:10:09        at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:48)
build   11-Jul-2014 12:10:09        at sbt.IvySbt$$anon$3.call(Ivy.scala:57)
build   11-Jul-2014 12:10:09        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)
build   11-Jul-2014 12:10:09        at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:81)
build   11-Jul-2014 12:10:09        at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
build   11-Jul-2014 12:10:09        at xsbt.boot.Using$.withResource(Using.scala:11)
build   11-Jul-2014 12:10:09        at xsbt.boot.Using$.apply(Using.scala:10)
build   11-Jul-2014 12:10:09        at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
build   11-Jul-2014 12:10:09        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
build   11-Jul-2014 12:10:09        at xsbt.boot.Locks$.apply0(Locks.scala:31)
build   11-Jul-2014 12:10:09        at xsbt.boot.Locks$.apply(Locks.scala:28)
build   11-Jul-2014 12:10:09        at sbt.IvySbt.withDefaultLogger(Ivy.scala:57)
build   11-Jul-2014 12:10:09        at sbt.IvySbt.withIvy(Ivy.scala:98)
build   11-Jul-2014 12:10:09        at sbt.IvySbt.withIvy(Ivy.scala:94)
build   11-Jul-2014 12:10:09        at sbt.IvySbt$Module.withModule(Ivy.scala:115)
build   11-Jul-2014 12:10:09        at sbt.IvyActions$.publish(IvyActions.scala:91)
build   11-Jul-2014 12:10:09        at sbt.Classpaths$$anonfun$publishTask$1.apply(Defaults.scala:1173)
build   11-Jul-2014 12:10:09        at sbt.Classpaths$$anonfun$publishTask$1.apply(Defaults.scala:1172)
build   11-Jul-2014 12:10:09        at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
build   11-Jul-2014 12:10:09        at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
build   11-Jul-2014 12:10:09        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
build   11-Jul-2014 12:10:09        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
build   11-Jul-2014 12:10:09        at sbt.std.Transform$$anon$4.work(System.scala:64)
build   11-Jul-2014 12:10:09        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
build   11-Jul-2014 12:10:09        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
build   11-Jul-2014 12:10:09        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
build   11-Jul-2014 12:10:09        at sbt.Execute.work(Execute.scala:244)
build   11-Jul-2014 12:10:09        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
build   11-Jul-2014 12:10:09        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
build   11-Jul-2014 12:10:09        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
build   11-Jul-2014 12:10:09        at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
build   11-Jul-2014 12:10:09        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
build   11-Jul-2014 12:10:09        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
build   11-Jul-2014 12:10:09        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
build   11-Jul-2014 12:10:09        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
build   11-Jul-2014 12:10:09        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
build   11-Jul-2014 12:10:09        at java.lang.Thread.run(Thread.java:744)
build   11-Jul-2014 12:10:09    [error] (dta-application-gateway/universal:publish) java.io.IOException: destination file exists and overwrite == false

@huntc
Copy link

huntc commented Jul 11, 2014

0.13.5 is out. Can you try that?

@matthughes
Copy link

Actually was mistaken in my post. I actually am running 0.13.5 final.

@jaceklaskowski
Copy link
Contributor

I managed to confirm that the warning goes away with isSnapshot := false in the build. See What's the preferred option to overwriting local artifacts with deprecated publishLocal?.

Be careful, though, with isSnapshot being mismatched with version since it's often used in publishTo to set the repository where the artifacts are deployed to.

alexdeleon added a commit to io-informatics/neo4j-rdf-plugin that referenced this issue Apr 14, 2015
@hochgi
Copy link

hochgi commented May 10, 2015

I'm experiencing the same problem with sbt 0.13.8.
specifying isSnapshot := false solves the problem.

i have a multi-project with 21 submodules, and I get this error for each project

    java.io.IOException: destination file exists and overwrite == false
    at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:75)
    at sbt.ConvertResolver$LocalIfFileRepo.put(ConvertResolver.scala:243)
    at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
    at sbt.ConvertResolver$ChecksumFriendlyURLResolver$class.put(ConvertResolver.scala:81)
    at sbt.ConvertResolver$$anonfun$defaultConvert$1$PluginCapableResolver$1.put(ConvertResolver.scala:115)
    at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216)
    at sbt.IvyActions$$anonfun$publish$3.apply(IvyActions.scala:336)
    at sbt.IvyActions$$anonfun$publish$3.apply(IvyActions.scala:335)
    at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:772)
    at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771)
    at sbt.IvyActions$.publish(IvyActions.scala:335)
    at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply$mcV$sp(IvyActions.scala:121)
    at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply(IvyActions.scala:121)
    at sbt.IvyActions$$anonfun$publish$1$$anonfun$apply$1.apply(IvyActions.scala:121)
    at sbt.IvyActions$.withChecksums(IvyActions.scala:130)
    at sbt.IvyActions$.sbt$IvyActions$$withChecksums(IvyActions.scala:125)
    at sbt.IvyActions$$anonfun$publish$1.apply(IvyActions.scala:121)
    at sbt.IvyActions$$anonfun$publish$1.apply(IvyActions.scala:114)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132)
    at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
    at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
    at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
    at xsbt.boot.Using$.withResource(Using.scala:10)
    at xsbt.boot.Using$.apply(Using.scala:9)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
    at sbt.IvySbt.withIvy(Ivy.scala:127)
    at sbt.IvySbt.withIvy(Ivy.scala:124)
    at sbt.IvySbt$Module.withModule(Ivy.scala:155)
    at sbt.IvyActions$.publish(IvyActions.scala:114)
    at sbt.Classpaths$$anonfun$publishTask$1.apply(Defaults.scala:1283)
    at sbt.Classpaths$$anonfun$publishTask$1.apply(Defaults.scala:1282)
    at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
    at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745

@muuki88
Copy link
Contributor

muuki88 commented Jun 17, 2015

The issue appeared for me as well while switching from Build.scala to build.sbt and upgrading 0.13.6 to 0.13.8. I'll try the isSnapshot := false option

@fleipold
Copy link

fleipold commented Jul 2, 2015

It would also be nice, if that exception would be caught and wrapped at a level that can provide meaningful information to the sbt user, so that the Exception message would be something along these lines:

Problem publishing <artefact-name> to repo <repo-info> in module <module-name>.
The probable cause of the problem is XYZ.
The underlying exception was:
java.io.IOException: destination file exists and overwrite == false

@hvesalai
Copy link
Contributor

Could we have an option to completely ignore this. I've got a multiproject build where I aggregate submodules so that publishing the main project publishes the submodules. Each submodule has its own version so often the submodule has already been published. I would like publish to work so that I can instruct it to just quietly fail if the artifact already exists (and to overwrite it if it is SNAPSHOT).

adpi2 pushed a commit to adpi2/sbt that referenced this issue Oct 9, 2024
Workaround for sbt#1156.

* Creates a new FileRepository that will stil allow local files
  to be transfered if overwrite is true (non-snapshot module),
  but will issue a warning about deprecated behavior.
* Ensure warning is long enough to annoy people into asking
  what it's about.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

10 participants