force package phase before mojo execution

This commit is contained in:
Sebastian Sdorra
2011-08-03 17:12:14 +02:00
parent 2a59c8c18a
commit 5a90fa2562
3 changed files with 22 additions and 3 deletions

View File

@@ -179,7 +179,7 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
String pluginDirectoryPath = pluginDirectory.getAbsolutePath();
installArtifact(excludeList, pluginDirectoryPath, classpath,
pluginRepository, projectArtifact);
pluginRepository, getPluginArtifact());
if (artifacts != null)
{
@@ -202,6 +202,25 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
protected Artifact getPluginArtifact()
{
if (projectArtifact.getFile() == null)
{
File file = new File(project.getBuild().getDirectory(),
project.getBuild().getFinalName().concat(".jar"));
projectArtifact.setFile(file);
}
return projectArtifact;
}
/**
* Method description
*

View File

@@ -49,7 +49,7 @@ import java.util.List;
* @author Sebastian Sdorra
* @goal install
* @requiresDependencyResolution runtime
* @phase package
* @execute phase="package"
*/
public class InstallMojo extends AbstractBaseScmMojo
{

View File

@@ -55,7 +55,7 @@ import java.util.List;
* @author Sebastian Sdorra
* @goal run
* @requiresDependencyResolution runtime
* @phase package
* @execute phase="package"
*/
public class RunMojo extends AbstractBaseScmMojo
{