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

java.io.IOException: destination file exists and overwrite == false (cross publishing with Java sub modules) #124

Open
Sciss opened this issue Apr 10, 2018 · 4 comments

Comments

@Sciss
Copy link

Sciss commented Apr 10, 2018

Issue #121 - which is closed - suggested that sbt-pgp 1.1.1 would fix this problem:

java.io.IOException: destination file exists and overwrite == false

Unfortunately that doesn't seem to be the case. I'm still running into it (sbt 1.1.2 and 1.1.4 tested), when publishing a cross-scala-version project to Sonatype, where there is a Java module that doesn't use cross versioning.

[info] 	published treetable-scala_2.12 to https://oss.sonatype.org/service/local/staging/deploy/maven2/de/sciss/treetable-scala_2.12/1.4.0/treetable-scala_2.12-1.4.0-sources.jar
[error] java.io.IOException: destination file exists and overwrite == false
[error] 	at org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:75)
[error] 	at sbt.internal.librarymanagement.ConvertResolver$LocalIfFileRepo.put(ConvertResolver.scala:365)
[error] 	at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
[error] 	at sbt.internal.librarymanagement.ConvertResolver$ChecksumFriendlyURLResolver.put(ConvertResolver.scala:117)
[error] 	at sbt.internal.librarymanagement.ConvertResolver$ChecksumFriendlyURLResolver.put$(ConvertResolver.scala:104)
[error] 	at sbt.internal.librarymanagement.ConvertResolver$$anonfun$defaultConvert$lzycompute$1$PluginCapableResolver$1.put(ConvertResolver.scala:164)
[error] 	at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216)
[error] 	at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$5(IvyActions.scala:499)
[error] 	at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$5$adapted(IvyActions.scala:498)
[error] 	at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:789)
[error] 	at scala.collection.Iterator.foreach(Iterator.scala:929)
[error] 	at scala.collection.Iterator.foreach$(Iterator.scala:929)
[error] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
[error] 	at scala.collection.IterableLike.foreach(IterableLike.scala:71)
[error] 	at scala.collection.IterableLike.foreach$(IterableLike.scala:70)
[error] 	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
[error] 	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:788)
[error] 	at sbt.internal.librarymanagement.IvyActions$.publish(IvyActions.scala:498)
[error] 	at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$3(IvyActions.scala:144)
[error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] 	at sbt.internal.librarymanagement.IvyActions$.withChecksums(IvyActions.scala:157)
[error] 	at sbt.internal.librarymanagement.IvyActions$.withChecksums(IvyActions.scala:151)
[error] 	at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$1(IvyActions.scala:144)
[error] 	at sbt.internal.librarymanagement.IvyActions$.$anonfun$publish$1$adapted(IvyActions.scala:134)
[error] 	at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:243)
[error] 	at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:204)
[error] 	at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error] 	at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[error] 	at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error] 	at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error] 	at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error] 	at xsbt.boot.Using$.withResource(Using.scala:10)
[error] 	at xsbt.boot.Using$.apply(Using.scala:9)
[error] 	at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error] 	at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error] 	at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error] 	at xsbt.boot.Locks$.apply(Locks.scala:28)
[error] 	at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error] 	at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199)
[error] 	at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196)
[error] 	at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:242)
[error] 	at sbt.internal.librarymanagement.IvyActions$.publish(IvyActions.scala:134)
[error] 	at sbt.Classpaths$.$anonfun$publishTask$4(Defaults.scala:2242)
[error] 	at sbt.Classpaths$.$anonfun$publishTask$4$adapted(Defaults.scala:2241)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:271)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)
[error] (treetable-java / publishSigned) java.io.IOException: destination file exists and overwrite == false
[error] Total time: 69 s, completed Apr 10, 2018 10:17:17 PM
@Sciss
Copy link
Author

Sciss commented Apr 10, 2018

Taking out crossScalaVersions from the java module fixed the problem.

@Sciss Sciss closed this as completed Apr 10, 2018
@Sciss
Copy link
Author

Sciss commented Apr 10, 2018

Bummer -- this breaks Travis

https://travis-ci.org/Sciss/TreeTable/jobs/364803657

So what's the right approach? I think it should simply overwrite == true..

@Sciss Sciss reopened this Apr 10, 2018
@Sciss
Copy link
Author

Sciss commented Apr 10, 2018

Is there a way to set overwrite := true. I'm staring at this, but have no idea.

@maesenka
Copy link

maesenka commented Jun 1, 2018

I have the exact same issue, also with the latest sbt-pgp version (1.1.1).

I'm publishing a scala module for scala versions 2.11 and 2.12, and a java module. When I run

sbt> + publishSigned

sbt first publishes the 2.11 scala and the java module but after switching to 2.12 it tries to publish the java module again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants