Add spring-boot dependency
Every ~100k recipes are ending up like ~100Mb in the index, so I don't expect to need to shard anytime soon meaning that my idea of using vert.x for its cute clustering functionalities is kind of dead. This patch is the first in a series to move to a simpler execution model.
- Id
- e53c746baadef2f3486ad3c5df4703e77eedd4b6
- Author
- Caio
- Commit time
- 2018-11-30T11:53:39+01:00
Modified pom.xml
<artifactId>cerberus</artifactId>
<version>1.0-SNAPSHOT</version>
<url>https://caio.co</url>
+ <packaging>jar</packaging>
+
+ <name>cerberus</name>
+ <description></description>
+
+ <parent>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>2.1.1.RELEASE</version>
+ <relativePath/> <!-- lookup parent from repository -->
+ </parent>
<properties>
+ <java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+ <start-class>co.caio.cerberus.boot.BootApplication</start-class>
<cerberus.launcher>co.caio.cerberus.service.CustomLauncher</cerberus.launcher>
<cerberus.main.verticle>co.caio.cerberus.service.MainVerticle</cerberus.main.verticle>
+
<os.classifier>linux-x86_64</os.classifier>
<immutables.version>2.7.3</immutables.version>
<jackson.version>2.9.7</jackson.version>
- <java.version>11</java.version>
- <junit.version>5.3.2</junit.version>
<logback.version>1.2.3</logback.version>
<lucene.version>7.5.0</lucene.version>
<netty.tcnative.version>2.0.20.Final</netty.tcnative.version>
<type>pom</type>
</dependency>
<dependency>
- <groupId>org.junit</groupId>
- <artifactId>junit-bom</artifactId>
- <version>${junit.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- <dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-stack-depchain</artifactId>
<version>${vertx.version}</version>
</dependencyManagement>
<dependencies>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-engine</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-junit5</artifactId>
<classifier>${os.classifier}</classifier>
<version>${netty.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-actuator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-tomcat</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-undertow</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>io.micrometer</groupId>
+ <artifactId>micrometer-registry-prometheus</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-devtools</artifactId>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
<build>
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>3.0.0-M2</version>
- <executions>
- <execution>
- <id>enforce-maven</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <configuration>
- <rules>
- <requireMavenVersion>
- <version>3.0.5</version>
- </requireMavenVersion>
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
- <configuration>
- <source>${java.version}</source>
- <target>${java.version}</target>
- <showWarnings>true</showWarnings>
- <showDeprecation>true</showDeprecation>
- <compilerArgs>-implicit:class</compilerArgs>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.22.0</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>3.2.0</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <manifestEntries>
- <Main-Class>${cerberus.launcher}</Main-Class>
- <Main-Verticle>${cerberus.main.verticle}</Main-Verticle>
- </manifestEntries>
- </transformer>
- <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
- <resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
- </transformer>
- </transformers>
- <artifactSet>
- </artifactSet>
- <outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>pl.project13.maven</groupId>
- <artifactId>git-commit-id-plugin</artifactId>
- <version>2.2.5</version>
- <executions>
- <execution>
- <id>get-the-git-infos</id>
- <goals>
- <goal>revision</goal>
- </goals>
- <phase>initialize</phase>
- </execution>
- <execution>
- <id>validate-the-git-infos</id>
- <goals>
- <goal>validateRevision</goal>
- </goals>
- <phase>package</phase>
- </execution>
- </executions>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- </includes>
- </resource>
- </resources>
</build>
<profiles>
Created src/main/java/co/caio/cerberus/boot/BootApplication.java
+package co.caio.cerberus.boot;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class BootApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(BootApplication.class, args);
+ }
+}
Created src/main/resources/application.properties
+#management.endpoint.metrics.enabled=true
+management.endpoint.prometheus.enabled=true
+management.endpoints.web.exposure.include=info,health,metrics,prometheus
Created src/test/java/co/caio/cerberus/boot/BootApplicationTests.java
+package co.caio.cerberus.boot;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class BootApplicationTests {
+
+ @Test
+ public void contextLoads() {}
+}