Maven war - 'packaging' with value 'war' is invalid. Aggregator projects require 'pom' as packaging

Viewed 9457

I have a maven project which previously worked with the following structure, except for the war packaging, build plugin and webapp/:

Project structure And the following parent pom.xml build cycle

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <warName>${project.artifactId}</warName>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <execution>
                        <id>install</id>
                        <phase>install</phase>
                        <goals>
                            <goal>sources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    <finalName>ConcertLiveCheck</finalName>
</build>

but, whenever i attempt to compile my project as a war, i receive the following error

    'packaging' with value 'war' is invalid. Aggregator projects require 'pom' as packaging

Beforehand, i was compiling as pom, without the maven war plugin and every maven module was compiling correctly to it's target, and my project was running. But, since i intend to run my project on a web server, i am attempting to compile to a POM, to later on auto deploy to my web server.

Any tips on solving the issue?

Thank you,

2 Answers

In my case I missed below <plugin> in my pom.

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
Related