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

requirejs maven plugin works fine, but minified resources are not included in the war #156

Open
nitinsurana opened this issue Dec 1, 2014 · 0 comments

Comments

@nitinsurana
Copy link

<plugins>
                    <plugin>
                        <groupId>com.github.mcheely</groupId>
                        <artifactId>requirejs-maven-plugin</artifactId>
                        <version>2.0.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>optimize</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- path to optimizer json config file -->
                            <configFile>${basedir}/src/main/webapp/js/build/build-config.js</configFile>
                            <!-- optional path to optimizer executable -->
                            <optimizerFile>${basedir}/src/main/webapp/js/build/r.js</optimizerFile>
                            <!-- whether or not to process config with maven filters -->
                            <filterConfig>true</filterConfig>
                            <!-- Skip requirejs optimization if true -->
                            <skip>false</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.4</version>
                        <configuration>
                            <warSourceExcludes>js/**,css/**</warSourceExcludes>
                            <packagingExcludes>%regex[js/lib/(?!require).*],template/**</packagingExcludes>
                        </configuration>
                    </plugin>
                </plugins>

build-config.js looks like

({
    appDir: "${basedir}/src/main/webapp",
    baseUrl: "js",
    dir: "../../target/build",

    optimizeCss: "standard.keepLines",
    mainConfigFile: "../../src/main/webapp/js/main.js",

    inlineText: true,
    removeCombined: true,
    fileExclusionRegExp: /^build/,

    modules: [
    {
        name: "main"
    }
    ]
})

The war-exclusion works fine, but the target/build is not included in the war built.

http://resthub.org/docs/quickstart/ - Just downloaded and ran

mvn package -Poptimize fails.

I am on windows 7 16-bit, jdk1.7

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

1 participant