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

useAllReactorProjects in assembly descriptor causes build failure #812

Open
ph33rtehgd opened this issue Jul 13, 2017 · 3 comments
Open

Comments

@ph33rtehgd
Copy link
Contributor

ph33rtehgd commented Jul 13, 2017

Please fill out the following information to help us in analyzing the issue, but feel free to skip it if you don't have the information at hand or if it does not apply. Please remove everything which does not apply to the issue. Including this info paragraph ;-)

Description

When using the true option of in the assembly descriptor the maven build will fail with: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

Info

  • d-m-p version : 0.21.0
  • Maven version (mvn -v) : 3.3.9 (Spring Tool Suite embedded)

  • Docker version : Docker version 17.05.0-ce, build 89658be
  • If it's a bug, how to reproduce
  1. Setup a basic project that will invoke the plugin's build goal.
  2. Attach an assembly descriptor within the tag whose contents contain a which hastrue

sample_assembly.txt

Full maven stacktrace:
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.21.0:build (build-image) on project assembly: Execution build-image of goal io.fabric8:docker-maven-plugin:0.21.0:build failed: Index: 0, Size: 0 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:docker-maven-plugin:0.21.0:build (build-image) on project assembly: Execution build-image of goal io.fabric8:docker-maven-plugin:0.21.0:build failed: Index: 0, Size: 0 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.PluginExecutionException: Execution build-image of goal io.fabric8:docker-maven-plugin:0.21.0:build failed: Index: 0, Size: 0 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPhase.getModuleProjects(ModuleSetAssemblyPhase.java:559) at org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPhase$1.accept(ModuleSetAssemblyPhase.java:134) at org.apache.maven.plugin.assembly.model.Assemblies.forEachModuleSet(Assemblies.java:40) at org.apache.maven.plugin.assembly.archive.phase.ModuleSetAssemblyPhase.execute(ModuleSetAssemblyPhase.java:126) at org.apache.maven.plugin.assembly.archive.DefaultAssemblyArchiver.createArchive(DefaultAssemblyArchiver.java:178) at io.fabric8.maven.docker.assembly.DockerAssemblyManager.createAssemblyArchive(DockerAssemblyManager.java:394) at io.fabric8.maven.docker.assembly.DockerAssemblyManager.createDockerTarArchive(DockerAssemblyManager.java:84) at io.fabric8.maven.docker.service.ArchiveService.createArchive(ArchiveService.java:102) at io.fabric8.maven.docker.service.BuildService.buildImage(BuildService.java:112) at io.fabric8.maven.docker.service.BuildService.buildImage(BuildService.java:60) at io.fabric8.maven.docker.BuildMojo.buildAndTag(BuildMojo.java:58) at io.fabric8.maven.docker.BuildMojo.executeInternal(BuildMojo.java:44) at io.fabric8.maven.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:223) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) ... 21 more

@ph33rtehgd
Copy link
Contributor Author

I've forked the repository and made some tweaks to the MojoParameters and DockerAssemblyConfigurationSource to pass through the reactorProjects maven variable and use this list of projects. By doing this the issue I was facing has been resolved. Would you like me to initiate a PR?

@rhuss
Copy link
Collaborator

rhuss commented Jul 14, 2017

Yes, of course. We ♥︎ pull requests ! ;-)

@ph33rtehgd
Copy link
Contributor Author

PR submitted. I had to add the signed off by after my initial commit (forgot it), and then I tried to squash the commits using the interactive rebase but it seems that it increased the number of commits instead of squashing it like I expected. I'm a Git neophyte, forgive me :(.

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