Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package de.saumya.mojo.rails3;
 
 import java.io.File;
 
 

Goal:
pom
public class PomMojo extends AbstractRailsMojo {

    

Parameter:
expression="${plugin}" @readonly
    PluginDescriptor plugin;

    

Parameter:
expression="${rails.pom.force}" default-value="false"
    boolean          force;

    

Parameter:
expression="${rails.gemfile}" default-value="${basedir}/Gemfile"
    File             gemfile;
    @Override
    protected void executeRails() throws MojoExecutionExceptionIOException,
            ScriptException {
        final File pomfile = new File(launchDirectory(), "pom.xml");
        if (this..exists()) {
            if (!(pomfile.exists() && this..lastModified() > pomfile.lastModified())
                    || this.) {
                if (this.) {
                    getLog().info("create pom using following versions:");
                    getLog().info("\tjruby-plugins-version: "
                            + this..getVersion());
                    getLog().info("\tjruby-version: " + this.);
                }
                // the actual execution of the script
                this..newScriptFromResource("maven/tools/rails_pom_mojo.rb")
                        .addArg("{:jruby_complete => '" + this.
                                + "', :jruby_plugins => '"
                                + this..getVersion() + "'}")
                        .addArg(this..getAbsoluteFile())
                        .executeIn(launchDirectory(), pomfile);
            }
            else {
                if (this.) {
                    getLog().info("pom is newer then Gemfile. skip creation of pom. force creation with -Drails.pom.force");
                }
            }
        }
        else {
            getLog().warn("no Gemfile. nothing to do. please specify one with -Drails.gemfile=...");
        }
    }
New to GrepCode? Check out our FAQ X