@@ -579,16 +579,22 @@ trait PublishLocalNoFluff extends SonatypeCentralPublishModule {
579579 ))
580580 }
581581
582- publisher.publishLocal(
583- jar = jar().path,
584- sourcesJar = emptyZip().path,
585- docJar = emptyZip().path,
586- pom = pom().path,
587- ivy = Right (ivy().path),
588- artifact = artifactMetadata(),
589- publishInfos = Seq .empty
582+ val artifact = artifactMetadata()
583+ val jarPath = jar().path
584+ val pomPath = pom().path
585+ val ivyPath = ivy().path
586+ val emptyPath = emptyZip().path
587+
588+ val contents = Map [os.SubPath , Array [Byte ]](
589+ os.sub / s " ${artifact.id}- ${artifact.version}.jar " -> os.read.bytes(jarPath),
590+ os.sub / s " ${artifact.id}- ${artifact.version}-sources.jar " -> os.read.bytes(emptyPath),
591+ os.sub / s " ${artifact.id}- ${artifact.version}-javadoc.jar " -> os.read.bytes(emptyPath),
592+ os.sub / s " ${artifact.id}- ${artifact.version}.pom " -> os.read.bytes(pomPath),
593+ os.sub / " ivy.xml" -> os.read.bytes(ivyPath)
590594 )
591595
596+ publisher.publishLocal(artifact, contents)
597+
592598 jar()
593599 }
594600}
@@ -613,48 +619,50 @@ trait LocalRepo extends Module {
613619 VcsVersion .vcsState()
614620 }
615621 def localRepoZip : T [PathRef ] = Task {
616- val repoVer = vcsState().format()
617- val ver = version()
618- localRepo()
619- val repoDir = BuildCtx .workspaceRoot / " out" / " repo" / ver
620- val destDir = Task .dest / ver / " repo.zip"
621- val dest = destDir / " repo.zip"
622-
623- import java .io ._
624- import java .util .zip ._
625- os.makeDir.all(destDir)
626- var fos : FileOutputStream = null
627- var zos : ZipOutputStream = null
628- try {
629- fos = new FileOutputStream (dest.toIO)
630- zos = new ZipOutputStream (new BufferedOutputStream (fos))
631-
632- val versionEntry = new ZipEntry (" version" )
633- versionEntry.setTime(0L )
634- zos.putNextEntry(versionEntry)
635- zos.write(repoVer.getBytes(StandardCharsets .UTF_8 ))
636- zos.flush()
637-
638- os.walk(repoDir).filter(_ != repoDir).foreach { p =>
639- val isDir = os.isDir(p)
640- val name = p.relativeTo(repoDir).toString + (if (isDir) " /" else " " )
641- val entry = new ZipEntry (name)
642- entry.setTime(os.mtime(p))
643- zos.putNextEntry(entry)
644- if (! isDir) {
645- zos.write(os.read.bytes(p))
646- zos.flush()
622+ BuildCtx .withFilesystemCheckerDisabled {
623+ val repoVer = vcsState().format()
624+ val ver = version()
625+ localRepo()
626+ val repoDir = BuildCtx .workspaceRoot / " out" / " repo" / ver
627+ val destDir = Task .dest / ver / " repo.zip"
628+ val dest = destDir / " repo.zip"
629+
630+ import java .io ._
631+ import java .util .zip ._
632+ os.makeDir.all(destDir)
633+ var fos : FileOutputStream = null
634+ var zos : ZipOutputStream = null
635+ try {
636+ fos = new FileOutputStream (dest.toIO)
637+ zos = new ZipOutputStream (new BufferedOutputStream (fos))
638+
639+ val versionEntry = new ZipEntry (" version" )
640+ versionEntry.setTime(0L )
641+ zos.putNextEntry(versionEntry)
642+ zos.write(repoVer.getBytes(StandardCharsets .UTF_8 ))
643+ zos.flush()
644+
645+ os.walk(repoDir).filter(_ != repoDir).foreach { p =>
646+ val isDir = os.isDir(p)
647+ val name = p.relativeTo(repoDir).toString + (if (isDir) " /" else " " )
648+ val entry = new ZipEntry (name)
649+ entry.setTime(os.mtime(p))
650+ zos.putNextEntry(entry)
651+ if (! isDir) {
652+ zos.write(os.read.bytes(p))
653+ zos.flush()
654+ }
655+ zos.closeEntry()
647656 }
648- zos.closeEntry()
657+ zos.finish()
658+ }
659+ finally {
660+ if (zos != null ) zos.close()
661+ if (fos != null ) fos.close()
649662 }
650- zos.finish()
651- }
652- finally {
653- if (zos != null ) zos.close()
654- if (fos != null ) fos.close()
655- }
656663
657- PathRef (dest)
664+ PathRef (dest)
665+ }
658666 }
659667
660668 def localRepoJar : T [PathRef ] = Task {
0 commit comments