diff --git a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc index 3cf85f7ce3..0048640e67 100644 --- a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc @@ -1043,7 +1043,7 @@ is set. The client component must be launched manually. ==== Running the remote client application -The remote client application is designed to be run from within you IDE. You need to run +The remote client application is designed to be run from within your IDE. You need to run `org.springframework.boot.devtools.RemoteSpringApplication` using the same classpath as the remote project that you're connecting to. The _non-option_ argument passed to the application should be the remote URL that you are connecting to. diff --git a/spring-boot-parent/pom.xml b/spring-boot-parent/pom.xml index a0f61d5080..a20caae353 100644 --- a/spring-boot-parent/pom.xml +++ b/spring-boot-parent/pom.xml @@ -237,6 +237,11 @@ kotlin-runtime 1.0.4 + + org.sonatype.plexus + plexus-build-api + 0.0.7 + org.zeroturnaround zt-zip diff --git a/spring-boot-samples/spring-boot-sample-data-cassandra/README.adoc b/spring-boot-samples/spring-boot-sample-data-cassandra/README.adoc index 2cee98998c..6712ec1a85 100644 --- a/spring-boot-samples/spring-boot-sample-data-cassandra/README.adoc +++ b/spring-boot-samples/spring-boot-sample-data-cassandra/README.adoc @@ -1,4 +1,12 @@ += Spring Boot Sample Data Cassandra +To run the project, need to run below `cql` commands on Cassandra. -CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; +== Keyspace Creation in Cassandra +[source,indent=0] +---- + CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 }; +---- +== Table Creation in Cassandra +Run `cql` using the link:src/test/resources/setup.cql[setup script] located in resources folder. diff --git a/spring-boot-samples/spring-boot-sample-devtools/src/main/resources/public/public.txt b/spring-boot-samples/spring-boot-sample-devtools/src/main/resources/public/public.txt new file mode 100644 index 0000000000..e258b6c5c8 --- /dev/null +++ b/spring-boot-samples/spring-boot-sample-devtools/src/main/resources/public/public.txt @@ -0,0 +1 @@ +public file diff --git a/spring-boot-samples/spring-boot-sample-devtools/src/test/java/sample/devtools/SampleDevToolsApplicationIntegrationTests.java b/spring-boot-samples/spring-boot-sample-devtools/src/test/java/sample/devtools/SampleDevToolsApplicationIntegrationTests.java index 41091ebf97..978353e4e5 100644 --- a/spring-boot-samples/spring-boot-sample-devtools/src/test/java/sample/devtools/SampleDevToolsApplicationIntegrationTests.java +++ b/spring-boot-samples/spring-boot-sample-devtools/src/test/java/sample/devtools/SampleDevToolsApplicationIntegrationTests.java @@ -16,11 +16,48 @@ package sample.devtools; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.assertj.core.api.Assertions.assertThat; + /** * Integration tests for {@link SampleDevToolsApplication}. * * @author Andy Wilkinson + * @author Phillip Webb */ +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) +@DirtiesContext public class SampleDevToolsApplicationIntegrationTests { + @Autowired + private TestRestTemplate restTemplate; + + @Test + public void testStaticResource() throws Exception { + ResponseEntity entity = this.restTemplate + .getForEntity("/css/application.css", String.class); + assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(entity.getBody()).contains("color: green;"); + } + + @Test + public void testPublicResource() throws Exception { + ResponseEntity entity = this.restTemplate.getForEntity("/public.txt", + String.class); + assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(entity.getBody()).contains("public file"); + } + } diff --git a/spring-boot-tools/spring-boot-maven-plugin/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/pom.xml index 2a0647b226..956dc69d75 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/pom.xml @@ -170,6 +170,10 @@ org.codehaus.plexus plexus-utils + + org.sonatype.plexus + plexus-build-api + org.apache.maven.plugins diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildInfoMojo.java b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildInfoMojo.java index 341438236e..482c4eb9c8 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildInfoMojo.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildInfoMojo.java @@ -22,10 +22,12 @@ import java.util.Map; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; +import org.sonatype.plexus.build.incremental.BuildContext; import org.springframework.boot.loader.tools.BuildPropertiesWriter; import org.springframework.boot.loader.tools.BuildPropertiesWriter.NullAdditionalPropertyValueException; @@ -41,6 +43,9 @@ import org.springframework.boot.loader.tools.BuildPropertiesWriter.ProjectDetail @Mojo(name = "build-info", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true) public class BuildInfoMojo extends AbstractMojo { + @Component + private BuildContext buildContext; + /** * The Maven project. */ @@ -67,6 +72,7 @@ public class BuildInfoMojo extends AbstractMojo { .writeBuildProperties(new ProjectDetails(this.project.getGroupId(), this.project.getArtifactId(), this.project.getVersion(), this.project.getName(), this.additionalProperties)); + this.buildContext.refresh(this.outputFile); } catch (NullAdditionalPropertyValueException ex) { throw new MojoFailureException(