Skip to content

Add "stop" goal for the spring-boot-maven-plugin #667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matsev opened this issue Apr 11, 2014 · 8 comments
Closed

Add "stop" goal for the spring-boot-maven-plugin #667

matsev opened this issue Apr 11, 2014 · 8 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@matsev
Copy link
Contributor

matsev commented Apr 11, 2014

It would be useful if a stop goal was added to the spring-boot-maven-plugin. This would make it possible to start the Spring Boot application in Maven's pre-integration-test phase and shut it down in the post-integration-test phase when implementing integration tests using the maven-failsafe-plugin.

Example usage:

<plugins>
    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
            <execution>
            <id>start-boot</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>run</goal>
            </goals>
            </execution>
            <execution>
                <id>stop-boot</id>
                <phase>post-integration-test</phase>
                <goals>
                    <goal>stop</goal>
                </goals>
                </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.17</version>
        <executions>
            <execution>
                <id>integration-test</id>
                <goals>
                    <goal>integration-test</goal>
                </goals>
            </execution>
            <execution>
                <id>verify</id>
                <goals>
                    <goal>verify</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    <!-- more plugins -->
</plugins>

Currently, the since there is no stop goal, Spring Boot has to be terminated manually after the integration tests have been completed.

Compare with the jetty and maven-failsafe configuration.

@seanmmills
Copy link

This addition would be useful. Maybe a start goal with no thread join and allowing a specified spring-boot artifact so that a separate maven project could hold integration tests.

@snicoll
Copy link
Member

snicoll commented Apr 14, 2014

we may want to check what the cargo plugin does in that area because it has a lot of maturity.

@seanmmills
Copy link

The cargo-maven-plugin came to mind, however, a more pure spring-boot application may be a nicer fit. Especially considering war provided scope issues described in #674, #649, and #650.

@snicoll
Copy link
Member

snicoll commented Apr 14, 2014

I didn't intend that you should look into using the cargo-maven-plugin. What I meant was that the plugin has options and names for the various goals that are really mature now (as lots of users came with feedback) so we should look at it when implementing a boot equivalent. Sorry if it wasn't clear.

@dsyer dsyer added this to the 1.1.0 milestone Apr 25, 2014
@matsev
Copy link
Contributor Author

matsev commented May 1, 2014

Second thought, I found a workaround using the @IntegrationTest and the @SpringApplicationConfiguration (where I use the same value for the classes attribute as configured in the <start-class> Maven property) that can be used during integration tests. I was not aware of this solution when I created this issue, and it makes the addition of a stop goal somewhat redundant.

@philwebb philwebb removed this from the 1.1.0 milestone May 1, 2014
@snicoll
Copy link
Member

snicoll commented May 21, 2014

I think it would. I suggest to document this approach properly so that others can find this out easily and resolve this one. We can revisit that later if necessary.

snicoll added a commit that referenced this issue May 26, 2014
Relates to gh-667
@philwebb philwebb added this to the 1.1.0.M2 milestone May 26, 2014
@dsyer dsyer removed the backlog label May 30, 2014
mdeinum pushed a commit to mdeinum/spring-boot that referenced this issue Jun 6, 2014
This commit clarifies how @IntegrationTEST can be used as an
alternative of starting the (web) application prior to running the
tests suite.

Fixes spring-projectsgh-667
mdeinum pushed a commit to mdeinum/spring-boot that referenced this issue Jun 6, 2014
@lucboutier
Copy link

Hi, I think that @IntegrationTEST is not good enough as you may want to run other kind of tests than java based (I have an AngularJS ui and uses protractor for testing the app).
So having cargo like start/stop for the plugin would be useful.

@snicoll snicoll modified the milestones: 1.2.0.M1, 1.1.0.M2 Sep 15, 2014
@snicoll
Copy link
Member

snicoll commented Sep 15, 2014

Please create a new issue, this one is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

6 participants