Skip to content

Commit

Permalink
Fixes #4013 - Add startTimeout to Piranha Maven plugin (#4015)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Sep 25, 2024
1 parent ac98df5 commit cf18731
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.maven.plugin.MojoExecutionException;
import static org.apache.maven.plugins.annotations.LifecyclePhase.NONE;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

/**
* This goal will deploy your web application and start Piranha in a separate
Expand All @@ -44,6 +45,12 @@
@Mojo(name = "start", defaultPhase = NONE)
public class StartMojo extends BaseMojo {

/**
* Stores the start timeout (in seconds).
*/
@Parameter(defaultValue = "600", property = "piranha.startTimeout", required = false)
protected Integer startTimeout;

/**
* Default constructor.
*/
Expand Down Expand Up @@ -161,7 +168,7 @@ private void startPiranha() throws IOException {
System.out.print(".");
} catch (InterruptedException ie) {
}
if (count == 600) {
if (count == startTimeout) {
System.out.println();
System.out.println("Warning, PID file not seen!");
break;
Expand Down
1 change: 1 addition & 0 deletions test/micro/helloworld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<configuration>
<distribution>${piranha.distribution}</distribution>
<httpPort>${httpPort}</httpPort>
<startTimeout>30</startTimeout>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit cf18731

Please sign in to comment.