Skip to content

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

Closed
@DimitriHautot

Description

@DimitriHautot

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

philwebb commented on Dec 4, 2014

@philwebb
Member

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

DimitriHautot commented on Dec 5, 2014

@DimitriHautot
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:

DimitriHautot

DimitriHautot commented on Dec 5, 2014

@DimitriHautot
Author

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

snicoll

snicoll commented on Dec 5, 2014

@snicoll
Member

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

snicoll commented on Dec 5, 2014

@snicoll
Member

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

snicoll commented on Dec 5, 2014

@snicoll
Member

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.

DimitriHautot

DimitriHautot commented on Dec 5, 2014

@DimitriHautot
Author

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

DimitriHautot

DimitriHautot commented on Dec 5, 2014

@DimitriHautot
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dsyer@snicoll@philwebb@DimitriHautot

        Issue actions

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