How can I change the lifecycle mapping in javascript-maven-plugin

Now, I using javascript-maven-plugin to develop my project. In the documents, the lifecycle mapping is as follows: http://mojo.codehaus.org/javascript-maven-tools/javascript-maven-plugin/extension-information.html

I want to import other library of files installed in repository of maven. I expected that jslint-maven-plugin lifecycle was called after js-import-maven-plugin lifecycle. However, the result turn out to be error, because the real lifecycle is as follows:

  • validate: Not defined
  • initialize: Not defined
  • generate-sources: Not defined
  • process-sources: org.codehaus.mojo:jslint-maven-plugin:1.0.1:jslint, org.codehaus.mojo:js-import-maven-plugin:1.0.1:import-js
  • generate-resources: org.codehaus.mojo:js-import-maven-plugin:1.0.1:generate-html
  • process-resources: org.apache.maven.plugins:maven-resources-plugin:2.5:resources
  • compile: Not defined
  • process-classes: Not defined
  • generate-test-sources: Not defined
  • process-test-sources: org.codehaus.mojo:jslint-maven-plugin:1.0.1:test-jslint, org.codehaus.mojo:js-import-maven-plugin:1.0.1:test-import-js
  • generate-test-resources: org.codehaus.mojo:js-import-maven-plugin:1.0.1:test-generate-html
  • process-test-resources: org.apache.maven.plugins:maven-resources-plugin:2.5:testResources
  • test-compile: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile
  • process-test-classes: Not defined
  • test: org.apache.maven.plugins:maven-surefire-plugin:2.9:test
  • prepare-package: org.codehaus.mojo:webminifier-maven-plugin:1.0.1:minify-js
  • package: Not defined
  • pre-integration-test: Not defined
  • integration-test: Not defined
  • post-integration-test: Not defined
  • verify: Not defined
  • install: org.apache.maven.plugins:maven-install-plugin:2.3.1:install
  • deploy: org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy

Now, I want to change the lifecycle mapping by editing the pom file like,

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jslint-maven-plugin</artifactId>
            <version>1.0.1</version>
            <executions>
                <execution>
                    <id>default-jslint</id>
                    <phase>process-resources</phase>
                </execution>
            </executions>
        </plugin>

However, it doesn't work.

How can I change the lifecycle mapping?

Answers


I’m not sure, but when you wanna change the phase, perhaps you must also specify the goal. Try this:

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jslint-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
            <execution>
                <id>default-jslint</id>
                <phase>process-resources</phase>
                <goals>
                    <goal>jslint</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

Need Your Help

Collection Merge in Java Spring using beans

java xml spring spring-mvc javabeans

I am new to Spring Framework.I am trying to merge two sets using spring.