Skip to content

Commit

Permalink
Fixed JaCoCo reports
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schnell committed Feb 3, 2024
1 parent cd05a32 commit fd655d2
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ jobs:
OSS_SONATYPE_TOKEN: ${{ secrets.OSS_SONATYPE_TOKEN }}
OSS_SONATYPE_GPG_PASSPHRASE: ${{ secrets.OSS_SONATYPE_GPG_PASSPHRASE }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./mvnw clean deploy jacoco:report sonar:sonar -U -B -P sonatype-oss-release --file pom.xml -s settings.xml
run: ./mvnw clean deploy jacoco:report -U -B -P sonatype-oss-release --file pom.xml -s settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package org.fuin.objects4j.common;

import jakarta.annotation.Nullable;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.constraints.NotEmpty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public static void requireArgMin(@NotNull final String name, @NotNull final long
public static void requireValid(@NotNull final Validator validator, @NotNull final Object value, @Nullable final Class<?>... groups)
throws ConstraintViolationException {

final Set<ConstraintViolation<Object>> constraintViolations = validator.validate(value);
final Set<ConstraintViolation<Object>> constraintViolations = validator.validate(value, groups);
if (!constraintViolations.isEmpty()) {
final StringBuilder sb = new StringBuilder();
for (final ConstraintViolation<Object> constraintViolation : constraintViolations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static InternetAddress parseArg(@NotNull final String name, @NotNull fin
final InternetAddress[] addr = InternetAddress.parse(trimmedLowerCaseValue, false);
if (addr.length != 1) {
throw new ConstraintViolationException(
"The argument 'emailAddress' is not a single address: '" + trimmedLowerCaseValue + "'");
"The argument '" + name + "' is not a single address: '" + trimmedLowerCaseValue + "'");
}
return addr[0];
} catch (final AddressException ex) {
Expand Down
80 changes: 80 additions & 0 deletions jacoco/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<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-jacoco</artifactId>

<dependencies>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-common</artifactId>
</dependency>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-core</artifactId>
</dependency>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-jaxb</artifactId>
</dependency>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-jsonb</artifactId>
</dependency>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-ui</artifactId>
</dependency>

</dependencies>

<build>

<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>

</build>

</project>
4 changes: 4 additions & 0 deletions jacoco/src/main/java/org/fuin/objects4j/jacoco/Dummy.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.fuin.objects4j.jacoco;

public class Dummy {
}
14 changes: 0 additions & 14 deletions junit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,6 @@
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.tngtech.archunit.lang.ConditionEvents;
import com.tngtech.archunit.lang.SimpleConditionEvent;
import org.fuin.objects4j.common.HasPublicStaticIsValidMethod;
import org.fuin.objects4j.common.HasPublicStaticIsValidMethodValidator;
import org.fuin.objects4j.common.HasPublicStaticIsValidMethods;

import java.util.Optional;
Expand All @@ -20,11 +19,8 @@
*/
public final class HasPublicStaticIsValidMethodCondition extends ArchCondition<JavaClass> {

private final HasPublicStaticIsValidMethodValidator validator;

public HasPublicStaticIsValidMethodCondition() {
super("have a public static 'is valid' method with the signature defined by the annotation");
validator = new HasPublicStaticIsValidMethodValidator();
}

@Override
Expand Down
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-junit</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.fuin</groupId>
<artifactId>utils4j</artifactId>
Expand Down Expand Up @@ -323,7 +329,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<argLine>-Duser.country=US -Duser.language=en --add-opens java.base/java.util=ALL-UNNAMED</argLine>
<argLine>-Duser.country=US -Duser.language=en --add-opens java.base/java.util=ALL-UNNAMED ${argLine}</argLine>
</configuration>
</plugin>

Expand Down Expand Up @@ -358,6 +364,7 @@
<module>jpa</module>
<module>jsonb</module>
<module>junit</module>
<module>jacoco</module>
</modules>

</project>

0 comments on commit fd655d2

Please sign in to comment.