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="${pom}" default-value="pom.xml"
    File    pom;

    

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

    

Parameter:
expression="${pom.gemfile}" default-value="${basedir}/Gemfile"
    File             gemfile;
    @Override
    protected void executeRails() throws MojoExecutionExceptionIOException,
            ScriptException {
        getLog().warn"DEPRECATED: just do not use that anymore. use gem:pom instead" );
        if (this..exists() && !this.) {
            getLog().info(this..getName()
                    + " already exists. use '-Dpom.force=true' to overwrite");
            return;
        }
        if (this..exists()) {
            if (!(this..exists() && this..lastModified() > this..lastModified())
                    || this.) {
                long stamp = -1;
                if (this..exists()) {
                    stamp = this..lastModified();
                }
                if (this.) {
                    getLog().info("create pom using following versions:");
                    getLog().info("\tjruby-plugins-version: "
                            + this..getVersion());
                    getLog().info("\tjruby-version: " + getJrubyVersion());
                }
                this..newScriptFromResource("maven/tools/pom_generator.rb")
                    .addArg("rails")
                    .addArg(this..getAbsoluteFile())
                    .addArg(this..getVersion())
                    .addArg(getJrubyVersion().toString())
                    .executeIn(launchDirectory(), this.);
                
                if (stamp > -1) {
                    this..setLastModified(stamp);
                }
            }
            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