mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-20 14:32:12 +01:00
added stage property to maven scmp:run goal
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user