question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error build a project with the same module and submodule name

See original GitHub issue

Plugin can’t build project with module structure like this basic module/basic module/submodule

Part of mvn compile -X -pl module/submodule jib:buildTar

> [DEBUG]     Snapshot dependencies:
> [DEBUG]         /usr/home/gals/.m2/repository/io/site/0.0.1-SNAPSHOT/basic-0.0.1-SNAPSHOT.jar
> [DEBUG]         /usr/home/gals/.m2/repository/io/site/module/basic/0.0.1-SNAPSHOT/basic-0.0.1-SNAPSHOT.jar
> [DEBUG]         /usr/home/gals/.m2/repository/io/site/module/submodule/0.0.1-SNAPSHOT/submodule-0.0.1-SNAPSHOT.jar

Trace output is

> [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.8:buildTar (default-cli) on project eth: Building image tarball failed: entry 'app/libs//basic-0.0.1-SNAPSHOT.jar' closed at '5340' before the '15583' bytes specified in the header were written -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.8:buildTar (default-cli) on project eth: Building image tarball failed
> 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
> 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
> 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
> 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
> 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
> 	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
> 	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
> 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
> 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
> 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
> 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
> 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
> 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
> 	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
> 	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
> 	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Building image tarball failed
> 	at com.google.cloud.tools.jib.maven.BuildTarMojo.execute(BuildTarMojo.java:148)
> 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
> 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
> 	... 20 more
> Caused by: java.io.IOException: entry 'app/libs//basic-0.0.1-SNAPSHOT.jar' closed at '5340' before the '15583' bytes specified in the header were written
> 	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry(TarArchiveOutputStream.java:419)
> 	at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeEntriesAsTarArchive(TarStreamBuilder.java:52)
> 	at com.google.cloud.tools.jib.blob.WriterBlob.writeTo(WriterBlob.java:36)
> 	at com.google.cloud.tools.jib.cache.CacheWriter.writeLayer(CacheWriter.java:73)
> 	at com.google.cloud.tools.jib.builder.steps.BuildAndCacheApplicationLayerStep.call(BuildAndCacheApplicationLayerStep.java:121)
> 	at com.google.cloud.tools.jib.builder.steps.BuildAndCacheApplicationLayerStep.call(BuildAndCacheApplicationLayerStep.java:37)
> 	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:127)
> 	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
> 	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:80)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> 	at java.lang.Thread.run(Thread.java:748)
> 	Suppressed: java.io.IOException: This archive contains unclosed entries.
> 		at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:289)
> 		at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:306)
> 		at com.google.cloud.tools.jib.tar.TarStreamBuilder.writeEntriesAsTarArchive(TarStreamBuilder.java:54)
> 		... 10 more

workaround is rename module/basic

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
loosebazookacommented, Nov 20, 2018

This is OK in WAR, since the group ID is appended.

You’re right, I seemed to have missed this. I guess we should solve it. Although I wonder if resolving the jars is deterministic in the build system? Should they be sorted by size?

1reaction
chanseokohcommented, Nov 20, 2018

I’ve thought about using numbers. I’d still add some special, discernible prefix, like -renamed-2, so that it doesn’t look like part of the semver versioning (e.g., -2 in 0.1.0-2 might look like the actual version of the dep). I vote for option 3 with a simple scheme, but if detecting dup seems unnecessarily complex, option 2 might be better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio | Submodules with same names causes build ...
So I've got a module for each feature, and underneath I have a submodule structure which is basically the same per feature module....
Read more >
Git - Submodules - Git SCM
Let's start by adding an existing Git repository as a submodule of the repository that we're working on. To add a new submodule...
Read more >
Import projects with different groups but same name
It appears that Idea can't import second project, because its try to make ij project with name "submodule", which exists (created by ...
Read more >
Git Submodules: Adding, Using, Removing, Updating
There are three main parts to this command: git submodule add – This simply tells Git that we are adding a submodule. This...
Read more >
Using Git submodules with GitLab CI/CD
When you use Git submodules, your project should have a file named ... When your submodule is on the same GitLab server, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found