Skip to content

spring-boot-maven-plugin - attached/main artifact error message #2060

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

Closed
DimitriHautot opened this issue Dec 4, 2014 · 8 comments
Closed
Labels
status: invalid An issue that we don't feel is valid

Comments

@DimitriHautot
Copy link

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.

@philwebb
Copy link
Member

philwebb commented 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?

@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Dec 4, 2014
@DimitriHautot
Copy link
Author

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:

@dsyer dsyer removed the status: waiting-for-feedback We need additional information before we can continue label Dec 5, 2014
@DimitriHautot DimitriHautot reopened this Dec 5, 2014
@DimitriHautot
Copy link
Author

Sorry, wrong button click. Please re-tag the issue with the "waiting-for-feedback" label.

@snicoll
Copy link
Member

snicoll commented 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
Copy link
Member

snicoll commented 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
Copy link
Member

snicoll commented 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 of finaleName).

If you don't want the bootify version at all, just don't use the repackage goal.

@snicoll snicoll added question status: waiting-for-feedback We need additional information before we can continue labels Dec 5, 2014
@DimitriHautot
Copy link
Author

(feedback: indeed, I gave some. I thought it was because I accidentally closed the ticket)

@DimitriHautot
Copy link
Author

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!

@dsyer dsyer removed the status: waiting-for-feedback We need additional information before we can continue label Dec 5, 2014
@philwebb philwebb added the status: invalid An issue that we don't feel is valid label Dec 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants