script
module.exports = {
plugins: [
require('postcss-preset-env')(),
require('postcss-clean')()
]
};
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>postcss</executable>
<arguments>
<argument>--config</argument>
<argument>postcss.config.js</argument>
<argument>src/main/resources/static/css</argument>
</arguments>
</configuration>
<dependencies>
<dependency>
<groupId>net.alchim31.maven</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<tasks>
<exec executable="postcss">
<argline>--config postcss.config.js src/main/resources/static/css</argline>
<classpath>
<path refid="maven.dependency.classpath" />
</classpath>
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.yahoo.platform.yui</groupId>
<artifactId>yuicompressor</artifactId>
<version>2.4.8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>