tschiela
tschiela

Reputation: 5271

How can i add configuration to maven-war-plugin?

For the first time i use eclipse with m2e and i want to configure the pom of the maven-war-plugin to add the correct path to my web.xml. If i try to edit the effective pom with the "Maven Pom editor", but the whole pom is readonly?

How can i solve these problem?

Greets Thomas

Upvotes: 1

Views: 4496

Answers (2)

khmarbaise
khmarbaise

Reputation: 97359

The effective pom is a merge between the super pom of Maven and may be other poms which are inherited and your project pom. So it does not make sense to change the effective-pom. You should change your own pom to fit your needs. The configuration of the maven-war-plugin works as usual in Maven like the following:

 <build>
    <plugins>
      ..
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          ...here your appropriate configurations
        </configuration>
      </plugin>
      ..
    </plugins>
  </build>

Upvotes: 2

Matthew Farwell
Matthew Farwell

Reputation: 61695

You can't edit the effective pom. You can only edit the pom. The effective pom is the pom with all of the default configuration values etc, and values taken from parent poms. Editing the pom will change the effective pom.

If you wish to change the default values in your pom, you can cut and paste from the effective pom, but only do it for the sections you need to change.

Upvotes: 0

Related Questions