mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '1.4.x' into 1.5.x
This commit is contained in:
commit
85504e74a6
@ -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.
|
||||
|
@ -237,6 +237,11 @@
|
||||
<artifactId>kotlin-runtime</artifactId>
|
||||
<version>1.0.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.plexus</groupId>
|
||||
<artifactId>plexus-build-api</artifactId>
|
||||
<version>0.0.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.zeroturnaround</groupId>
|
||||
<artifactId>zt-zip</artifactId>
|
||||
|
@ -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.
|
||||
|
@ -0,0 +1 @@
|
||||
public file
|
@ -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<String> 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<String> entity = this.restTemplate.getForEntity("/public.txt",
|
||||
String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody()).contains("public file");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -170,6 +170,10 @@
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.sonatype.plexus</groupId>
|
||||
<artifactId>plexus-build-api</artifactId>
|
||||
</dependency>
|
||||
<!-- Optional -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user