org.apache.maven.plugin.MojoFailureException.initCause()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.apache.maven.plugin.MojoFailureException.initCause()方法的一些代码示例,展示了MojoFailureException.initCause()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MojoFailureException.initCause()方法的具体详情如下:
包路径:org.apache.maven.plugin.MojoFailureException
类名称:MojoFailureException
方法名:initCause

MojoFailureException.initCause介绍

暂无

代码示例

代码示例来源:origin: org.objectweb.fractal.cecilia.toolchain/maven-ceciliaadl-plugin

@Override
protected void handleException(InvalidCommandLineException e)
  throws Exception {
 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 PrintStream ps = new PrintStream(baos);
 printHelp(ps);
 ps.flush();
 MojoFailureException mojoFailureException = new MojoFailureException(
   null, e.getMessage(), baos.toString());
 mojoFailureException.initCause(e);
 throw mojoFailureException;
}

代码示例来源:origin: org.codehaus.mojo.groovy/groovy-maven-plugin

/**
 * Main Mojo execution hook.  Sub-class should use {@link #doExecute} instead.
 */
public void execute() throws MojoExecutionException, MojoFailureException {
  try {
    doExecute();
  }
  catch (Exception e) {
    //
    // NOTE: Wrap to avoid truncating the stacktrace
    //
    if (e instanceof MojoExecutionException) {
      throw new MojoExecutionException(e.getMessage(), e);
    }
    else if (e instanceof MojoFailureException) {
      MojoFailureException x = new MojoFailureException(e.getMessage());
      x.initCause(e);
      throw x;
    }
    else {
      throw new MojoExecutionException(e.getMessage(), e);
    }
  }
}

代码示例来源:origin: org.codehaus.gmaven/gmaven-plugin

/**
 * Main Mojo execution hook.  Sub-class should use {@link #doExecute} instead.
 */
public synchronized void execute() throws MojoExecutionException, MojoFailureException {
  try {
    doExecute();
  }
  catch (Exception e) {
    //
    // NOTE: Wrap to avoid truncating the stacktrace
    //
    if (e instanceof MojoExecutionException) {
      throw new MojoExecutionException(e.getMessage(), e);
    }
    else if (e instanceof MojoFailureException) {
      MojoFailureException x = new MojoFailureException(e.getMessage());
      x.initCause(e);
      throw x;
    }
    else {
      throw new MojoExecutionException(e.getMessage(), e);
    }
  }
}

代码示例来源:origin: org.objectweb.fractal.cecilia.toolchain/maven-ceciliaadl-plugin

@Override
protected void handleException(ADLException e) throws Exception {
 MojoFailureException mojoFailureException = new MojoFailureException(e
   .getError().toString());
 mojoFailureException.initCause(e);
 throw mojoFailureException;
}

代码示例来源:origin: org.codehaus.mojo/build-helper-maven-plugin

private void set( Interpreter interpreter, String name, Object value )
    throws MojoFailureException
  {
    try
    {
      interpreter.set( name, value );
    }
    catch ( EvalError ee )
    {
      MojoFailureException mfe = new MojoFailureException( "cannot define Beanshell global variable '" + name
        + "': " + ee.getMessage() );
      mfe.initCause( ee );
      throw mfe;
    }
  }
}

代码示例来源:origin: mojohaus/build-helper-maven-plugin

private void set( Interpreter interpreter, String name, Object value )
    throws MojoFailureException
  {
    try
    {
      interpreter.set( name, value );
    }
    catch ( EvalError ee )
    {
      MojoFailureException mfe = new MojoFailureException( "cannot define Beanshell global variable '" + name
        + "': " + ee.getMessage() );
      mfe.initCause( ee );
      throw mfe;
    }
  }
}

代码示例来源:origin: org.apache.geronimo.genesis.plugins/plugin-support

x.initCause(e);
throw x;

代码示例来源:origin: org.codehaus.mojo/plugin-support

x.initCause(e);
throw x;

代码示例来源:origin: org.codehaus.mojo/build-helper-maven-plugin

mfe.initCause( ee );
throw mfe;
    mfe.initCause( ee );
    throw mfe;

代码示例来源:origin: mojohaus/build-helper-maven-plugin

mfe.initCause( ee );
throw mfe;
    mfe.initCause( ee );
    throw mfe;

代码示例来源:origin: org.apache.maven.plugins/maven-dependency-plugin

failure.initCause( e );
failure.initCause( e );

代码示例来源:origin: opoo/opoopress

throw ex;
} catch (Exception ex) {
  throw (MojoFailureException) new MojoFailureException(ex.getMessage()).initCause(ex);

代码示例来源:origin: apache/maven-archetype

throw (MojoFailureException) new MojoFailureException( ex.getMessage() ).initCause( ex );

代码示例来源:origin: org.apache.maven.plugins/maven-archetype-plugin

throw (MojoFailureException) new MojoFailureException( ex.getMessage() ).initCause( ex );

相关文章