Skip to content

Commit

Permalink
Refactoring of modules and packages
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schnell committed Jan 28, 2024
1 parent cac000c commit 252cc1d
Show file tree
Hide file tree
Showing 400 changed files with 20,828 additions and 16,316 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
Expand All @@ -34,21 +34,21 @@ jobs:
run: java -version && ./mvnw -version && gpg --version

- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.OSS_SONATYPE_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.OSS_SONATYPE_GPG_PASSPHRASE }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
!.github
!.mvn
target
META-INF
*.log
4 changes: 0 additions & 4 deletions META-INF/beans.xml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ A library with common Java types that are mostly immutable value objects.
[![Java Development Kit 17](https://img.shields.io/badge/JDK-17-green.svg)](https://openjdk.java.net/projects/jdk/17/)

## Versions
- 0.9.x (or later) = **Java 17**
- 0.10.x(or later) = **New (incompatible) module structure** (See [New Module Structure](new-module-structure.md))
- 0.9.0 = **Java 17**
- 0.8.0 = **Java 11** with new **jakarta** namespace
- 0.7.x = **Java 11** before namespace change from 'javax' to 'jakarta'
- 0.6.9 (or previous) = **Java 8**
Expand Down
132 changes: 132 additions & 0 deletions common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-parent</artifactId>
<version>0.10.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>objects4j-common</artifactId>

<dependencies>

<!-- Compile -->

<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>

<!-- Test -->

<dependency>
<groupId>org.fuin</groupId>
<artifactId>utils4j</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</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</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>

<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>

<plugin>
<groupId>io.smallrye</groupId>
<artifactId>jandex-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jdeps-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>jakarta.el:jakarta.el-api</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.glassfish:jakarta.el</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>org.hibernate.validator:hibernate-validator</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>

</plugins>

</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
/**
* Copyright (C) 2015 Michael Schnell. All rights reserved.
* http://www.fuin.org/
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option) any
* later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see http://www.gnu.org/licenses/.
*/
package org.fuin.objects4j.common;

import jakarta.validation.ConstraintViolation;

import java.util.Collections;
import java.util.Set;

/**
* The contract that was checked is violated.
*/
public final class ConstraintViolationException extends RuntimeException {

private static final long serialVersionUID = 1L;

private final Set<ConstraintViolation<Object>> constraintViolations;

/**
* Constructor with error message.
*
* @param message
* Message.
*/
public ConstraintViolationException(final String message) {
super(message);
this.constraintViolations = null;
}

/**
* Constructor with error message and constraint violations.
*
* @param message
* Message.
* @param constraintViolations
* Constraint violations.
*/
public ConstraintViolationException(final String message, final Set<ConstraintViolation<Object>> constraintViolations) {
super(message);
this.constraintViolations = constraintViolations;
}

/**
* Returns the constraint violations.
*
* @return Immutable set of constraint violations or <code>null</code> if only a message is available.
*/
public final Set<ConstraintViolation<Object>> getConstraintViolations() {
if (constraintViolations == null) {
return null;
}
return Collections.unmodifiableSet(constraintViolations);
}

}
/**
* Copyright (C) 2015 Michael Schnell. All rights reserved.
* http://www.fuin.org/
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option) any
* later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see http://www.gnu.org/licenses/.
*/
package org.fuin.objects4j.common;

import jakarta.validation.ConstraintViolation;

import java.util.Collections;
import java.util.Set;

/**
* The contract that was checked is violated.
*/
public final class ConstraintViolationException extends RuntimeException {

private static final long serialVersionUID = 1L;

private final Set<ConstraintViolation<Object>> constraintViolations;

/**
* Constructor with error message.
*
* @param message
* Message.
*/
public ConstraintViolationException(final String message) {
super(message);
this.constraintViolations = null;
}

/**
* Constructor with error message and constraint violations.
*
* @param message
* Message.
* @param constraintViolations
* Constraint violations.
*/
public ConstraintViolationException(final String message, final Set<ConstraintViolation<Object>> constraintViolations) {
super(message);
this.constraintViolations = constraintViolations;
}

/**
* Returns the constraint violations.
*
* @return Immutable set of constraint violations or <code>null</code> if only a message is available.
*/
public final Set<ConstraintViolation<Object>> getConstraintViolations() {
if (constraintViolations == null) {
return null;
}
return Collections.unmodifiableSet(constraintViolations);
}

}
Loading

0 comments on commit 252cc1d

Please sign in to comment.