Skip to content
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

(update) spring boot 2.0.0.RELEASE #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class VertxMicroserviceEngine implements
* Sets the system properties and sets up the logger. {@inheritDoc}
*/
@Override
public Object[] bootstrap() {
public Class<?>[] bootstrap() {

System.setProperty("vertx.logger-delegate-factory-class-name", "io.vertx.core.logging.SLF4JLogDelegateFactory");

Expand All @@ -76,7 +76,7 @@ public Object[] bootstrap() {
System.setProperty("logging.config", logbackFile.getAbsolutePath());
}

return new Object[] {
return new Class<?>[] {
VertxConfig.class,
VertxMicroserviceEngine.class
};
Expand Down
9 changes: 2 additions & 7 deletions ms-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.2</version>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
Expand Down Expand Up @@ -121,11 +121,6 @@
<artifactId>jcl-over-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -152,7 +147,7 @@
<inherited>false</inherited>
<configuration>
<rules>
<dependencyConvergence />
<dependencyConvergence/>
</rules>
</configuration>
</execution>
Expand Down
7 changes: 4 additions & 3 deletions ms-common/src/main/java/net/trajano/ms/Microservice.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.springframework.boot.Banner.Mode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;

import net.trajano.ms.spi.MicroserviceEngine;

Expand Down Expand Up @@ -79,14 +80,14 @@ public static void run(final Class<? extends Application> applicationClass,
}
Microservice.applicationClass = applicationClass;

final Object[] bootstrapObjects = microserviceEngine.bootstrap();
final Object[] sources = new Object[extraSources.length + bootstrapObjects.length];
final Class<?>[] bootstrapObjects = microserviceEngine.bootstrap();
final Class<?>[] sources = new Class<?>[extraSources.length + bootstrapObjects.length];

System.arraycopy(extraSources, 0, sources, 0, extraSources.length);
System.arraycopy(bootstrapObjects, 0, sources, extraSources.length, bootstrapObjects.length);

final SpringApplication springApplication = new SpringApplication(sources);
springApplication.setWebEnvironment(false);
springApplication.setWebApplicationType(WebApplicationType.NONE);
springApplication
.setBannerMode(Mode.OFF);
springApplication.run(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ public interface MicroserviceEngine {

/**
* Performs the initialization of the microservice engine and returns an array
* of objects that would be used to bootstrap Spring.
* of classes that would be used to bootstrap Spring.
*
* @return starting context objects.
* @return starting context classes.
*/
Object[] bootstrap();
Class<?>[] bootstrap();

/**
* Gets the host name of where the engine is running. This may be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void setEngines(final MicroserviceEngine... engines) {
public void bootstrapTest() throws Exception {

final MicroserviceEngine microserviceEngine = Mockito.mock(MicroserviceEngine.class);
Mockito.when(microserviceEngine.bootstrap()).thenReturn(new Object[] {
Mockito.when(microserviceEngine.bootstrap()).thenReturn(new Class<?>[] {
MyApp.class
});
new TestMicroservice().setEngines(microserviceEngine);
Expand All @@ -49,7 +49,7 @@ public void bootstrapTest() throws Exception {
public void doubleRunTest() throws Exception {

final MicroserviceEngine microserviceEngine = Mockito.mock(MicroserviceEngine.class);
Mockito.when(microserviceEngine.bootstrap()).thenReturn(new Object[] {
Mockito.when(microserviceEngine.bootstrap()).thenReturn(new Class<?>[] {
MyApp.class
});
new TestMicroservice().setApplicationAndEngines(MyApp.class, microserviceEngine);
Expand Down
6 changes: 6 additions & 0 deletions ms-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-codegen</artifactId>
<version>${vertx.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions ms-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
<artifactId>jcl-over-slf4j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-codegen</artifactId>
<version>${vertx.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.trajano.commons</groupId>
<artifactId>commons-testing</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;

Expand All @@ -28,7 +29,7 @@ public static void main(final String[] args) {

final SpringApplication application = new SpringApplication(GatewayMS.class);
application.setBannerMode(Mode.OFF);
application.setWebEnvironment(false);
application.setWebApplicationType(WebApplicationType.NONE);
application.run(args);

}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<linkcheck.skip>true</linkcheck.skip>
<repo.id>app-ms</repo.id>
<slf4j.version>1.7.16</slf4j.version>
<spring.boot.version>1.5.10.RELEASE</spring.boot.version>
<spring.boot.version>2.0.0.RELEASE</spring.boot.version>
<vertx.version>3.5.1</vertx.version>
</properties>
<dependencyManagement>
Expand Down