added stage property to maven scmp:run goal

This commit is contained in:
Sebastian Sdorra
2012-02-03 17:50:48 +01:00
parent 38fde6e46b
commit 4246ddea02
2 changed files with 52 additions and 20 deletions

View File

@@ -405,17 +405,18 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
*/
private void readClasspathFile(List<String> classpath, File classpathFile)
{
try
{
JAXBContext context = JAXBContext.newInstance(Classpath.class);
try
{
JAXBContext context = JAXBContext.newInstance(Classpath.class);
Unmarshaller unmarshaller = context.createUnmarshaller();
Classpath c = (Classpath) unmarshaller.unmarshal(classpathFile);
classpath.addAll(c.getClasspathElements());
}
catch (JAXBException ex)
{
throw new RuntimeException(ex);
}
Classpath c = (Classpath) unmarshaller.unmarshal(classpathFile);
classpath.addAll(c.getClasspathElements());
}
catch (JAXBException ex)
{
throw new RuntimeException(ex);
}
}
/**
@@ -430,16 +431,18 @@ public abstract class AbstractBaseScmMojo extends AbstractScmMojo
Classpath c = new Classpath();
c.setClasspathElements(classpath);
try
{
JAXBContext context = JAXBContext.newInstance(Classpath.class);
try
{
JAXBContext context = JAXBContext.newInstance(Classpath.class);
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(c, classpathFile);
}
catch (JAXBException ex)
{
throw new RuntimeException(ex);
}
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.marshal(c, classpathFile);
}
catch (JAXBException ex)
{
throw new RuntimeException(ex);
}
}
}

View File

@@ -117,6 +117,17 @@ public class RunMojo extends AbstractBaseScmMojo
return port;
}
/**
* Method description
*
*
* @return
*/
public String getStage()
{
return stage;
}
/**
* Method description
*
@@ -219,6 +230,17 @@ public class RunMojo extends AbstractBaseScmMojo
this.port = port;
}
/**
* Method description
*
*
* @param stage
*/
public void setStage(String stage)
{
this.stage = stage;
}
/**
* Method description
*
@@ -258,6 +280,8 @@ public class RunMojo extends AbstractBaseScmMojo
try
{
System.setProperty("scm.home", scmHome);
System.setProperty("scm.stage", stage);
System.out.println("SET STAGE " + stage);
// enable debug logging
System.setProperty("logback.configurationFile", loggginConfiguration);
@@ -318,6 +342,11 @@ public class RunMojo extends AbstractBaseScmMojo
*/
private int port = 8081;
/**
* @parameter expression="${scm.stage}" default-value="DEVELOPMENT"
*/
private String stage = "DEVELOPMENT";
/**
* @parameter
*/