Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle + Minify not working #164

Open
darshandiscus opened this issue Oct 16, 2018 · 3 comments
Open

Bundle + Minify not working #164

darshandiscus opened this issue Oct 16, 2018 · 3 comments

Comments

@darshandiscus
Copy link

darshandiscus commented Oct 16, 2018

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.

@darshandiscus
Copy link
Author

Any update on this?

@Laazarus
Copy link

I am having the same problem,

I get illegal argument exceptions using the bundle

@Laazarus
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants