Changeset 10:0fc58f949978

Updated to use parent pom and removed archunit test
author unexist
date Sat, 03 Apr 2021 16:04:07 +0200
parents 7cdb54e3b07d
children 424dfcfae8cb
files pom.xml src/test/java/dev/unexist/showcase/todo/LayerArchUnitTest.java
diffstat 2 files changed, 12 insertions(+), 287 deletions(-) [+]
line wrap: on
line diff
--- a/pom.xml	Sat Apr 03 16:03:23 2021 +0200
+++ b/pom.xml	Sat Apr 03 16:04:07 2021 +0200
@@ -3,80 +3,27 @@
          xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <modelVersion>4.0.0</modelVersion>
-    <groupId>dev.unexist.showcase</groupId>
     <artifactId>quarkus-pipes-filters-showcase</artifactId>
-    <version>0.8</version>
-    <properties>
-        <compiler-plugin.version>3.8.1</compiler-plugin.version>
-        <maven.compiler.parameters>true</maven.compiler.parameters>
-        <maven.compiler.release>11</maven.compiler.release>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-
-        <apache-commons-lang.version>3.11</apache-commons-lang.version>
-        <hg-revision-plugin.version>0.10</hg-revision-plugin.version>
-        <surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
-        <jackson-modules-java8.version>2.12.1</jackson-modules-java8.version>
-        <cloudevents.version>2.0.0.RC2</cloudevents.version>
-
-        <!-- Quarkus -->
-        <quarkus-plugin.version>1.11.1.Final</quarkus-plugin.version>
-        <quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
-        <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
-        <quarkus.platform.version>1.11.1.Final</quarkus.platform.version>
+    <version>0.1</version>
 
-        <!-- Audit -->
-        <checkstyle-plugin.version>3.1.1</checkstyle-plugin.version>
-        <spotbugs-maven-plugin.version>4.1.3</spotbugs-maven-plugin.version>
-        <spotbugs-plugin.version>4.1.4</spotbugs-plugin.version>
+    <parent>
+        <groupId>dev.unexist.showcase</groupId>
+        <artifactId>quarkus-showcase-parent</artifactId>
+        <version>0.1</version>
+    </parent>
 
-        <!-- Testing -->
-        <archunit.version>0.14.1</archunit.version>
-
-        <!-- Workaround to get the timestamp -->
-        <timestamp>${maven.build.timestamp}</timestamp>
-        <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
+    <properties>
+        <!-- Cloudevents -->
+        <cloudevents.version>2.0.0.RC2</cloudevents.version>
+        <cloudevents-api.version>1.3.0</cloudevents-api.version>
     </properties>
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>${quarkus.platform.group-id}</groupId>
-                <artifactId>${quarkus.platform.artifact-id}</artifactId>
-                <version>${quarkus.platform.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
+
     <dependencies>
         <!-- Quarkus -->
         <dependency>
             <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy-jackson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-smallrye-openapi</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
             <artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
         </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-hibernate-validator</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.fasterxml.jackson.module</groupId>
-            <artifactId>jackson-modules-java8</artifactId>
-            <version>${jackson-modules-java8.version}</version>
-            <type>pom</type>
-        </dependency>
 
         <!-- Cloudevents -->
         <dependency>
@@ -87,7 +34,7 @@
         <dependency>
             <groupId>io.cloudevents</groupId>
             <artifactId>cloudevents-api</artifactId>
-            <version>1.3.0</version>
+            <version>${cloudevents-api.version}</version>
         </dependency>
 
         <dependency>
@@ -95,180 +42,5 @@
             <artifactId>cloudevents-json-jackson</artifactId>
             <version>${cloudevents.version}</version>
         </dependency>
-
-        <!-- Apache Commons -->
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-            <version>${apache-commons-lang.version}</version>
-        </dependency>
-
-        <!-- Testing -->
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-junit5</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.rest-assured</groupId>
-            <artifactId>rest-assured</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.tngtech.archunit</groupId>
-            <artifactId>archunit-junit5</artifactId>
-            <version>${archunit.version}</version>
-        </dependency>
     </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>io.quarkus</groupId>
-                <artifactId>quarkus-maven-plugin</artifactId>
-                <version>${quarkus-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>generate-code</goal>
-                            <goal>generate-code-tests</goal>
-                            <goal>build</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>${compiler-plugin.version}</version>
-                <configuration>
-                    <release>${maven.compiler.release}</release>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>${surefire-plugin.version}</version>
-                <configuration>
-                    <systemPropertyVariables>
-                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
-                        <maven.home>${maven.home}</maven.home>
-                    </systemPropertyVariables>
-                </configuration>
-            </plugin>
-
-            <!-- Info -->
-            <plugin>
-                <groupId>com.github.volodya-lombrozo</groupId>
-                <artifactId>hg-revision-plugin</artifactId>
-                <version>${hg-revision-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>scan</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <!-- Audit -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-checkstyle-plugin</artifactId>
-                <version>${checkstyle-plugin.version}</version>
-                <configuration>
-                    <configLocation>checkstyle/config.xml</configLocation>
-                    <suppressionsLocation>checkstyle/suppressions.xml</suppressionsLocation>
-                    <encoding>UTF-8</encoding>
-                    <consoleOutput>true</consoleOutput>
-                    <failsOnError>true</failsOnError>
-                    <linkXRef>false</linkXRef>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>run-checkstyle</id>
-                        <phase>validate</phase>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>com.github.spotbugs</groupId>
-                <artifactId>spotbugs-maven-plugin</artifactId>
-                <version>${spotbugs-maven-plugin.version}</version>
-                <dependencies>
-                    <!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
-                    <dependency>
-                        <groupId>com.github.spotbugs</groupId>
-                        <artifactId>spotbugs</artifactId>
-                        <version>${spotbugs-plugin.version}</version>
-                    </dependency>
-                </dependencies>
-                <executions>
-                    <execution>
-                        <id>run-spotbugs</id>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>check</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-
-        <!-- Replace placeholder in application.properties -->
-        <resources>
-            <resource>
-                <filtering>true</filtering>
-                <directory>src/main/resources</directory>
-                <includes>
-                    <include>application.properties</include>
-                </includes>
-            </resource>
-        </resources>
-    </build>
-    <profiles>
-        <profile>
-            <id>native</id>
-            <activation>
-                <property>
-                    <name>native</name>
-                </property>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-failsafe-plugin</artifactId>
-                        <version>${surefire-plugin.version}</version>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>integration-test</goal>
-                                    <goal>verify</goal>
-                                </goals>
-                                <configuration>
-                                    <systemPropertyVariables>
-                                        <native.image.path>
-                                            ${project.build.directory}/${project.build.finalName}-runner
-                                        </native.image.path>
-                                        <java.util.logging.manager>org.jboss.logmanager.LogManager
-                                        </java.util.logging.manager>
-                                        <maven.home>${maven.home}</maven.home>
-                                    </systemPropertyVariables>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-            <properties>
-                <quarkus.package.type>native</quarkus.package.type>
-            </properties>
-        </profile>
-    </profiles>
 </project>
--- a/src/test/java/dev/unexist/showcase/todo/LayerArchUnitTest.java	Sat Apr 03 16:03:23 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/**
- * @package Quarkus-Arch-Testing-Showcase
- *
- * @file Layer Tests
- * @copyright 2021 Christoph Kappel <christoph@unexist.dev>
- * @version $Id$
- *
- * This program can be distributed under the terms of the GNU GPLv2.
- * See the file LICENSE for details.
- **/
-
-package dev.unexist.showcase.todo;
-
-import com.tngtech.archunit.core.domain.JavaClasses;
-import com.tngtech.archunit.core.importer.ClassFileImporter;
-import com.tngtech.archunit.junit.AnalyzeClasses;
-import org.junit.jupiter.api.Test;
-
-import static com.tngtech.archunit.library.Architectures.layeredArchitecture;
-
-@AnalyzeClasses(packages = "dev.unexist.showcase.todo")
-public class LayerArchUnitTest {
-    private final JavaClasses classes = new ClassFileImporter().importPackages("dev.unexist.showcase.todo");
-
-    @Test
-    public void testLayeredArch() {
-        layeredArchitecture()
-            .layer("Adapters")
-                .definedBy("..adapters..")
-            .layer("Application")
-                .definedBy("..application..")
-            .layer("Domain")
-                .definedBy("..domain..")
-            .layer("Infrastructure")
-                .definedBy("..infrastructure..")
-
-            .whereLayer("Adapters")
-                .mayNotBeAccessedByAnyLayer()
-            .whereLayer("Application")
-                .mayOnlyBeAccessedByLayers("Adapters")
-            .whereLayer("Domain")
-                .mayOnlyBeAccessedByLayers("Adapters", "Application")
-            .whereLayer("Infrastructure")
-                .mayOnlyBeAccessedByLayers("Adapters", "Application", "Infrastructure")
-            .check(classes);
-    }
-}