minify-maven-plugin
minify-maven-plugin copied to clipboard
Bundle + Minify not working
I am trying this plugin in my sample project but my project remains same as it is, after clean and build.
Please find my project structure :
├── pom.xml
└── src
├── main
│ ├── java
│ │ └── com
│ │ └── darshan
│ │ └── SourceMapFilter.java
│ ├── resources
│ │ ├── readme.txt
│ │ └── static-bundles.json
│ └── webapp
│ ├── css
│ │ ├── custom.css
│ │ └── style.css
│ ├── index.html
│ ├── js
│ │ ├── custom.js
│ │ └── script.js
│ ├── META-INF
│ │ └── context.xml
│ └── WEB-INF
│ └── web.xml
└── test
└── java
static-bundles.json
{
"bundles": [
{
"type": "css",
"name": "static-combined.css",
"files": [
"custom.css",
"style.css"
]
},
{
"type": "js",
"name": "static-combined.js",
"files": [
"custom.js",
"script.js"
]
}
]
}
pom.xml plugin configuration
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>minify-maven-plugin</artifactId>
<version>1.7.6</version>
<executions>
<execution>
<id>bundle-minify</id>
<phase>package</phase>
<goals>
<goal>minify</goal>
</goals>
<configuration>
<webappSourceDir>${project.basedir}</webappSourceDir>
<webappTargetDir>${project.basedir}</webappTargetDir>
<cssSourceDir>css</cssSourceDir>
<cssSourceFiles>
<cssSourceFile>custom.css</cssSourceFile>
<cssSourceFile>style.css</cssSourceFile>
</cssSourceFiles>
<cssTargetDir>css</cssTargetDir>
<cssFinalFile>static-combined.css</cssFinalFile>
<cssSourceDir>js</cssSourceDir>
<jsSourceFiles>
<jsSourceFile>custom.js</jsSourceFile>
<jsSourceFile>script.js</jsSourceFile>
</jsSourceFiles>
<jsTargetDir>js</jsTargetDir>
<jsFinalFile>static-combined.js</jsFinalFile>
</configuration>
</execution>
</executions>
</plugin>
I have tried it with absolute path but not working. Using JDK 1.8. Please help.
Any update on this?
I am having the same problem,
I get illegal argument exceptions using the bundle
OK, It was my mistake I got it working fine even with the boundle: @darshandiscus if can help this is my pom configuration
<configuration> <charset>UTF-8</charset> <verbose>true</verbose> <webappSourceDir>${user.dir}</webappSourceDir> <webappTargetDir>${user.dir}</webappTargetDir> <cssSourceDir>/bootstrap/webfiles/src/main/resources/site</cssSourceDir> <jsSourceDir>/bootstrap/webfiles/src/main/resources/site</jsSourceDir> <bundleConfiguration>${user.dir}/bootstrap/webfiles/src/main/resources/site/boundle.json</bundleConfiguration> <jsEngine>CLOSURE</jsEngine> </configuration>