Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Here's an example of how to this.

  • Create a simple web application using maven archetype:
  • mvn archetype:generate -DarchetypeGroupId=org.codehaus.groovy.maven.archetypes -DgroupId=com.foo -DartifactId=example -Dpackage=com.lackey
  • choose option 18 (simple web app -- this will generate a simple web app project).
  • cd example
  • create a file src/main/webapp/server.properties
  • run: mvn package
  • notice you have a file target/example/server.properties -- this means server.properties will end up in your .war.
  • now change your pom file to include the following directives in the <build> block:
Code Block
  <build>
    <finalName>findFiles</finalName>
    <plugins>
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.1-beta-1</version>
          <configuration>
              <warSourceExcludes>**/*.jsp</warSourceExcludes>
          </configuration>
      </plugin>
    </plugins>
  </build>
  • run: mvn package (again)

notice the file target/example/server.properties is no longer present. You can check the .war as well, it won't be there, which is what you want in this case.

...