mavenbuildjarpom.xmltarget

No target folder generated after running mvn clean install


i am unable to see target folder after running mvn clean install Here is my parent pom.Traget folder is missing in folder structure. Build message is successful though

 <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.6.3</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
        <groupId>abc.def.ghi.jkl.ABCservice</groupId>
        <artifactId>abc-def-service</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <name>Abc Def Service</name>
        <description>Abc Def Service</description>
        <packaging>pom</packaging>
        <properties>
            <java.version>11</java.version>
            <flyway.version>6.4.4</flyway.version>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
            </dependency>
    
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
        </dependencies>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
                <plugin>
                        <groupId>org.flywaydb</groupId>
                        <artifactId>flyway-maven-plugin</artifactId>
                        <inherited>false</inherited>
                        <configuration>
                            <configFiles>${project.basedir}/../flyway/flyway.conf</configFiles>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>com.microsoft.sqlserver</groupId>
                                <artifactId>mssql-jdbc</artifactId>
                                <version>7.4.1.jre8</version>
                            </dependency>
                        </dependencies>
                    </plugin>
            </plugins>
        </build>
    
    </project>

Below is my child pom that i want to create jar file for to use in my Docker image building. Somehow target folder is not being created

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>abc.def.ghi.jkl.app</groupId>
        <artifactId>abc-def-service</artifactId>
        <relativePath>../../pom.xml</relativePath>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <artifactId>abc-def-application</artifactId>
    <name>abc-def-application</name>
    
    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.6.3</version>
                <configuration>
                    <mainClass>abc.def.ghi.MainApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

Solution

  • in parent pom, i was using pom, which should not be used . It should either be jar or should not be specified at all.

    https://github.com/eugenp/tutorials/issues/2414