Description
Hello,
I tried to boot-ify an existing web application, with success.
Then I am now trying to change the project to deliver a .war file again. The spring-boot-maven-plugin output an error message:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.1.9.RELEASE:repackage (default) on project rod-web-bootify: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.1.9.RELEASE:repackage failed: For artifact {be.rtbf.radio.rod:rod-web-bootify:1.2-SNAPSHOT:war}: An attached artifact must have a different ID than its corresponding main artifact. -> [Help 1]
However, given the required configuration parameter finalName, the .war file is well repackaged:
-rw-r--r-- 1 Dimitri staff 31633041 4 déc 17:34 rod-web-bootify##1.2-SNAPSHOT.dih-bootified.war
-rw-r--r-- 1 Dimitri staff 92815 4 déc 17:34 rod-web-bootify##1.2-SNAPSHOT.jar
-rw-r--r-- 1 Dimitri staff 29072903 4 déc 17:34 rod-web-bootify##1.2-SNAPSHOT.war
I don't know where the problem lies, but the error message is inaccurate: the boot-ified war has been produced, and its content is indeed self-executable.
Spring version: 4.0.8.RELEASE.
Spring-boot-* versions: 1.1.9.RELEASE, 1.1.8.RELEASE
Maven versions: 3.2.1, 3.2.3
This (https://stackoverflow.com/questions/26101652/maven-package-error-an-attached-artifact-must-have-a-different-id-than-its-corr) issue show the same problem, with version 1.1.5 of spring-boot-*.
If needed, I can provide more information.
Thanks.
Activity
philwebb commentedon Dec 4, 2014
Are you able to share your POM file, or better still a project that replicates the issue? Could you also run the build with the
-x
flag and attach any stacktrace output?DimitriHautot commentedon Dec 5, 2014
Unfortunately, I am not able to share the project right now. I would have to remove parts to squeeze it.
If really needed, I'll do the work.
Otherwise, here are 3 gists:
DimitriHautot commentedon Dec 5, 2014
Sorry, wrong button click. Please re-tag the issue with the "waiting-for-feedback" label.
snicoll commentedon Dec 5, 2014
well you gave some feedback, didn't you? I had a quick look to your pom and there's nothing out of the ordinary. I am not 100% sure that hard-coding the layout to war is a good idea as it's auto-detected anyway. I'll have a look
snicoll commentedon Dec 5, 2014
No need for your project, I was able to reproduce the issue by creating a sample war project from start.spring.io and pasting your pom instead...
snicoll commentedon Dec 5, 2014
I am not sure I understand what you're trying to do exactly. You want to deploy the "main" artifact as a regular war (non executable) and have the bootify version as a separate artifact, is that right? If that's what you want to do, finalName is definitely not the option for that (though I reckon it's confusing). Try to replace that by
<classifier>dih-bootified</classifier>
(instead offinaleName
).If you don't want the bootify version at all, just don't use the repackage goal.
DimitriHautot commentedon Dec 5, 2014
(feedback: indeed, I gave some. I thought it was because I accidentally closed the ticket)
DimitriHautot commentedon Dec 5, 2014
Thanks Stéphane, it is indeed what I was looking for, and it works by replacing finalName parameter by classifier.
So on my side, I am satisfied with your explanation. It is indeed not a bug, we can close the ticket.
Thanks a lot again!