Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpringBoot: can't create ear with maven: Unable to deduce layout

I have a SpringBoot project with the war and ear module, that I build using maven ( a build automation tool used primarily for Java projects.) and IntelliJ IDEA This is my pom.xml of the war project:

        <?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
            <modelVersion>4.0.0</modelVersion>
            <parent>
                <groupId>com.bendiciones</groupId>
                <artifactId>bendiciones-parent</artifactId>
                <version>4.0.0-SNAPSHOT</version>
            </parent>

            <artifactId>bendiciones-ear</artifactId>
            <packaging>ear</packaging>


            <dependencies>
                <dependency>
                    <groupId>com.bendiciones</groupId>
                    <artifactId>bendiciones-war</artifactId>
                    <version>${project.version}</version>
                    <type>war</type>
                </dependency>
            </dependencies>





 <build>
        <plugins>
            <plugin>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.10.1</version>
                <configuration>
                    <finalName>${project.build.finalName}-${project.version}</finalName>
                    <earSourceDirectory>src/main/resources</earSourceDirectory>
                    <packagingExcludes>**/*.jar</packagingExcludes>
                    <modules>
                        <webModule>
                            <groupId>com.bendiciones</groupId>
                            <artifactId>bendiciones-war</artifactId>
                            <contextRoot>/bendiciones</contextRoot>
                            <bundleFileName>bendiciones.war</bundleFileName>
                        </webModule>
                    </modules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <releaseProfiles>release</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <preparationGoals>clean install</preparationGoals>
                    <arguments>-DaltDeploymentRepository=releases::default::http://el1881.bc:8081/nexus/content/repositories/MicroserviceReleases</arguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <configuration>
                            <layout>NONE</layout>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <finalName>bendiciones</finalName>
    </build>


        </project>

But when I build the class I have this error:

 [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.5.RELEASE:repackage (repackage) on project bendiciones-ear: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.5.RELEASE:repackage failed: Unable to deduce layout for '/bendiciones/bendiciones-ear/target/bendiciones-4.0.0-SNAPSHOT.ear' -> [Help 1]
 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.5.RELEASE:repackage (repackage) on project bendiciones-ear: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.5.RELEASE:repackage failed: Unable to deduce layout for '/bendiciones/bendiciones-ear/target/bendiciones-4.0.0-SNAPSHOT.ear'
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
like image 740
Sandro Rey Avatar asked Oct 18 '25 08:10

Sandro Rey


1 Answers

Try removing the following from your top pom...

        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
like image 169
Simeon Hearring Avatar answered Oct 20 '25 01:10

Simeon Hearring