caio.co/de/cerberus

Revert "Stop using spring-boot-starter-parent as parent"

This reverts commit 0a72f9527905c4ca3af4e0577eaac6761e2894bf.

I've done it and decided to go back. These are the things I had to
do to make the multi-project setup happen:

1. Move the `co.caio.cerberus.boot` into a separate module (web)
2. Move the rest into a library module (core)
3. Create a parent pom with shared dependencies, move the
   non-shared dependencies around so that they belong to their
   respective module
4. Make the core library ship a test jar (as simple as activating
   the `test-jar` goal from maven-jar-plugin) so that both modules
   have access to the sample recipes and utilities
5. Change Util.java (test scope) to use .getResourceAsStream() so
   that we can static load it from #3's jar (*shrug* this is so
   poorly documented that I'm not really sure why .getResource()
   wasn't working.

(NOTE that this means there's a little bit of the strong coupling
I wanted to avoid by moving to multi-modules in the first place-
At least it is just for tests...)

After that was done I wanted to ship the `core` module separately
so that the `web` module would only evolve when I released a new
core version (same way as I'm interacting with `tablier`); This
led me to start fighting with `mvn release:*` since I doesn't
like SNAPSHOTS - so my solution would be to not have the `web`
module as part of the multi-module project, which meant that
the split was pretty much useless as I wouldn't be sharing things
from the parent POM unless I started being sillier...

Anyway, while doing all this and questioning my sanity I decided
that the best way would be to just split the repository and be
done with it. If I revisit this I'll probably:

1. Split the `boot` package into it's own repository; And
2. Create a separate project which just ships a parent pom
   in case I really want/need to share the pluginManagement
   section

But that's a story for another day, I've spent time with this for
no particular gain (besides understanding a bit more about maven,
so there's that). The result of this saga is in the
`dropped-multi-module` branch in case I ever need to look back.
Id
520517bc90ec24373b394ca945461d27f619b2a4
Author
Caio
Commit time
2019-02-19T17:20:47-03:00

Modified pom.xml

@@ -13,34 +13,33
<name>cerberus</name>
<description></description>

+ <parent>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-parent</artifactId>
+ <version>2.1.3.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>

- <maven.compiler.source>${java.version}</maven.compiler.source>
- <maven.compiler.target>${java.version}</maven.compiler.target>
-
<start-class>co.caio.cerberus.boot.BootApplication</start-class>

+ <os.classifier>linux-x86_64</os.classifier>
<immutables.version>2.7.5</immutables.version>
<jackson.version>2.9.8</jackson.version>
<logback.version>1.2.3</logback.version>
<lucene.version>7.7.0</lucene.version>
-
<flatbuffers.version>1.10.0.2</flatbuffers.version>
<flatbuffers.sources>${basedir}/src/main/flatbuffers</flatbuffers.sources>
<flatbuffers.generated.sources>${project.build.directory}/generated-sources/java</flatbuffers.generated.sources>
-
<junit.jupiter.version>5.4.0</junit.jupiter.version>
<resilience4j.version>0.13.2</resilience4j.version>
<chronicle.version>3.17.0</chronicle.version>
<jsoup.version>1.11.3</jsoup.version>
<tablier.version>0.2.1</tablier.version>
- <spring-boot.version>2.1.3.RELEASE</spring-boot.version>
-
- <maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
</properties>

<dependencyManagement>
@@ -51,13 +50,6
<version>${jackson.version}</version>
<scope>import</scope>
<type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-dependencies</artifactId>
- <type>pom</type>
- <version>${spring-boot.version}</version>
- <scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
@@ -195,238 +187,113
</dependencies>

<build>
- <resources>
- <resource>
- <directory>${basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/application*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}/src/main/resources</directory>
- <excludes>
- <exclude>**/application*.properties</exclude>
- </excludes>
- </resource>
- </resources>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${maven-surefire-plugin.version}</version>
- </plugin>
- <!-- Apply more sensible defaults for user projects -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <parameters>true</parameters>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <mainClass>${start-class}</mainClass>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>pl.project13.maven</groupId>
- <artifactId>git-commit-id-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>revision</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <verbose>false</verbose>
- <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
- <generateGitPropertiesFile>true</generateGitPropertiesFile>
- <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>repackage</id>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <mainClass>${start-class}</mainClass>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <configuration>
- <keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
- <createDependencyReducedPom>true</createDependencyReducedPom>
- <filters>
- <filter>
- <artifact>*:*</artifact>
- <excludes>
- <exclude>META-INF/*.SF</exclude>
- <exclude>META-INF/*.DSA</exclude>
- <exclude>META-INF/*.RSA</exclude>
- </excludes>
- </filter>
- </filters>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>${spring-boot.version}</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <transformers>
- <transformer
- implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
- <resource>META-INF/spring.handlers</resource>
- </transformer>
- <transformer
- implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
- <resource>META-INF/spring.factories</resource>
- </transformer>
- <transformer
- implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
- <resource>META-INF/spring.schemas</resource>
- </transformer>
- <transformer
- implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
- <transformer
- implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <mainClass>${start-class}</mainClass>
- </transformer>
- </transformers>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <version>${spring-boot.version}</version>
- <executions>
- <execution>
- <goals>
- <goal>build-info</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <!-- flatbuffers start -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>3.1.1</version>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>com.github.davidmoten</groupId>
- <artifactId>flatbuffers-compiler</artifactId>
- <version>${flatbuffers.version}</version>
- <type>tar.gz</type>
- <classifier>distribution-linux</classifier>
- <overWrite>true</overWrite>
- <outputDirectory>${project.build.directory}</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.6.0</version>
- <executions>
- <execution>
- <goals>
- <goal>exec</goal>
- </goals>
- <phase>generate-sources</phase>
- <configuration>
- <executable>${project.build.directory}/bin/flatc</executable>
- <workingDirectory>${flatbuffers.sources}</workingDirectory>
- <arguments>
- <argument>--java</argument>
- <argument>-o</argument>
- <argument>${flatbuffers.generated.sources}</argument>
- <argument>recipe.fbs</argument>
- </arguments>
- </configuration>
- </execution>
- <execution>
- <id>build-index</id>
- <configuration>
- <workingDirectory>${project.basedir}</workingDirectory>
- <executable>java</executable>
- <arguments>
- <argument>-classpath</argument>
- <classpath/>
- <argument>-Xmx1024m</argument>
- <argument>-Xms1024m</argument>
- <argument>-Dlogback.configurationFile=src/test/resources/logback-test.xml</argument>
- <argument>co.caio.cerberus.Loader</argument>
- <argument>src/main/resources/cerberus.properties</argument>
- <argument>tmp/document.jsonlines</argument>
- </arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>3.0.0</version>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${flatbuffers.generated.sources}</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- flatbuffers end -->
- </plugins>
- </build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build-info</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>pl.project13.maven</groupId>
+ <artifactId>git-commit-id-plugin</artifactId>
+ <configuration>
+ <verbose>false</verbose>
+ </configuration>
+ </plugin>
+ <!-- flatbuffers start -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>3.1.1</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.github.davidmoten</groupId>
+ <artifactId>flatbuffers-compiler</artifactId>
+ <version>${flatbuffers.version}</version>
+ <type>tar.gz</type>
+ <classifier>distribution-linux</classifier>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.6.0</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <phase>generate-sources</phase>
+ <configuration>
+ <executable>${project.build.directory}/bin/flatc</executable>
+ <workingDirectory>${flatbuffers.sources}</workingDirectory>
+ <arguments>
+ <argument>--java</argument>
+ <argument>-o</argument>
+ <argument>${flatbuffers.generated.sources}</argument>
+ <argument>recipe.fbs</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>build-index</id>
+ <configuration>
+ <workingDirectory>${project.basedir}</workingDirectory>
+ <executable>java</executable>
+ <arguments>
+ <argument>-classpath</argument>
+ <classpath/>
+ <argument>-Xmx1024m</argument>
+ <argument>-Xms1024m</argument>
+ <argument>-Dlogback.configurationFile=src/test/resources/logback-test.xml</argument>
+ <argument>co.caio.cerberus.Loader</argument>
+ <argument>src/main/resources/cerberus.properties</argument>
+ <argument>tmp/document.jsonlines</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>3.0.0</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${flatbuffers.generated.sources}</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- flatbuffers end -->
+ </plugins>
+ </build>
</project>