Question: I am developing a web application using Spring Boot, and want to generate war instead of jar.

It works very fine using the conversion from jar to war described here : <http://spring.io/guides/gs/convert-jar-to-war/>

But I want to exclude the application.properties from the war, because I use `@PropertySource(value = "file:${OPENSHIFT_DATA_DIR}/application.properties")` to get the file path on production environment.

* This method works when generating my war, but in eclipse I can't run my application because application.properties not copied at all to target/classes :

```
<build>
    <resources> 
        <resource> 
            <directory>src/main/resources</directory> 
            <excludes> 
                <exclude>application.properties</exclude> 
            </excludes> 
        </resource> 
     </resources> 
</build>

```
* This method doesn't work at all, I think that spring-boot-maven-plugin doesn't support packagingExcludes :

```
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration> 
                <packagingExcludes>WEB-INF/classes/application.properties</packagingExcludes> 
            </configuration> 
        </plugin>
    </plugins>
</build>

```

Have you another suggestion?

Thanks

Answer: 
The solution I added is to unzip my packaged war, delete the file application.properties and create a new war named ROOT.war using maven-antrun-plugin and run some ant tasks.

this is what i added to my plugins in pom.xml :

```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
    <execution>
        <id>package</id>
        <phase>package</phase>
        <configuration>
            <target>
                <unzip src="target/${artifactId}-${version}.${packaging}" dest="target/ROOT/" />
                <delete file="target/ROOT/WEB-INF/classes/application.properties"/>
                <zip destfile="target/ROOT.war" basedir="target/ROOT" encoding="UTF-8"/>
                <delete dir="target/ROOT"/>
            </target>
        </configuration>
        <goals>
            <goal>run</goal>
        </goals>
    </execution>
</executions>
</plugin>

```

I named my target war as ROOT.war because I am using tomcat on openshift PaaS, so I just copy my ROOT.war and push to my openshift repo. That's it
Try to using this solution:

```
<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>${spring.version}</version>
    <configuration>
        <addResources>false</addResources>
    </configuration>
</plugin>

```

**<addResources>false</addResources>** will keep properties when you run mvn spring-boot:run