Geting this error on: mvn package
It fails to build every time with the same error, I\'ve tried renaming the artifact, as well as changing dependencies for build in the
As Dimitri suggested, I solved this by adding classifier
to spring-boot-maven-plugin:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>boot</classifier>
</configuration>
</plugin>
I am currently facing the same issue. However, providing the required parameter finalName, I can see that the .war file is well boot-ified. Please note that I still encounter the error message in both cases (with and without the finalName).
Here is the link to the issue I opened on the Spring Boot project: https://github.com/spring-projects/spring-boot/issues/2060
Looks like a bug in spring-boot-maven-plugin
together with your version of Maven.
As far as I can tell, Maven knows that the WAR plugin will generate the file target/compiled-1.0-SNAPSHOT.war
. when it asks the spring-boot-maven-plugin
for its output, it will get the same name. Since Maven doesn't know what the plugin does, it will assume that both are configured to create the same output file and stop since that can't be what you want (the files will overwrite each other).
Try with the latest version of Maven or file a bug against the spring-boot-maven-plugin
. Let them know which version of Maven you're using.
All that is required is to include a <finalName>
tag in the build
section.
<build>
<finalName>myJar</finalName>
</build>