@Test(expected = MojoExecutionException.class) public void testExecute_fails() throws Exception { final OpearPackageMojo mojo = newMojo(); final MavenProject project = mock(MavenProject.class); when(project.clone()).thenReturn(project); mojo.project = project; final MavenSession session = mock(MavenSession.class); mojo.session = session; final MavenExecutionRequest executionRequest = mock(MavenExecutionRequest.class); when(session.getRequest()).thenReturn(executionRequest); mojo.execute(); }
@Override public void execute() throws MojoExecutionException, MojoFailureException { resolveDependencies(project.getDependencies(), true); try { final File finalFile = assembleOpear(); attachArtifact(finalFile); } catch (Exception e) { throw new MojoExecutionException("Failed to assemble the opear file.", e); } }
OpearPackageMojo extends AbstractCommonMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { resolveDependencies(project.getDependencies(), true); try { final File finalFile = assembleOpear(); attachArtifact(finalFile); } catch (Exception e) { throw new MojoExecutionException("Failed to assemble the opear file.", e); } } }
OpearPackageMojo extends AbstractCommonMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { resolveDependencies(project.getDependencies(), true); try { final File finalFile = assembleOpear(); attachArtifact(finalFile); } catch (Exception e) { throw new MojoExecutionException("Failed to assemble the opear file.", e); } }  }
OpearPackageMojo extends AbstractCommonMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { resolveDependencies(project.getDependencies(), true); try { final File finalFile = assembleOpear(); attachArtifact(finalFile); } catch (Exception e) { throw new MojoExecutionException("Failed to assemble the opear file.", e); } }  @Override void execute(); }
OpearPackageMojo extends AbstractCommonMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { resolveDependencies(project.getDependencies(), true); try { final File finalFile = assembleOpear(); attachArtifact(finalFile); } catch (Exception e) { throw new MojoExecutionException("Failed to assemble the opear file.", e); } }  @Override void execute(); static final String OPEAR; }