Skip to content

Commit

Permalink
Merge dc8d7aa into b5e5995
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcin committed Apr 27, 2020
2 parents b5e5995 + dc8d7aa commit 578e8de
Show file tree
Hide file tree
Showing 250 changed files with 6,369 additions and 2,021 deletions.
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ matrix:
dist: trusty
language: java
jdk: oraclejdk8
script: ./mvnw -B -e verify site site:stage
script: ./mvnw -B -e -fae verify site site:stage
after_success:
- ./mvnw -B -Pcoverage clean verify coveralls:report
- ./mvnw -B -fae -Pcoverage clean verify coveralls:report
- os: linux
dist: trusty
language: java
Expand All @@ -21,6 +21,14 @@ matrix:
dist: trusty
language: java
jdk: openjdk11
- os: linux
dist: trusty
language: java
jdk: oraclejdk14
- os: linux
dist: trusty
language: java
jdk: openjdk14
- os: windows
language: bash
before_script:
Expand All @@ -31,7 +39,7 @@ matrix:
# for jdk 11.0.1+13
osx_image: xcode10.1
script:
- ./mvnw -B -e verify
- ./mvnw -B -e -fae verify
cache:
directories:
- $HOME/.m2
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,30 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)

## [Unreleased]

### Added

- API extracted to net.adamcin.oakpal.api package in new oakpal-api module for tighter dependency control, requiring a major version bump.
- @ProviderType and @ConsumerType annotations added to interfaces in exported packages
- Added setResourceBundle() method to ViolationReporter interface and default implementations to support future i18n enhancements.
- Added SimpleViolation.builder() with easy support for formatting violation description with MessageFormat.format(), using withArguments() builder method.
- Migrated CompositeStoreAlignment check from ACS AEM Commons because of unavoidable tight-coupling to oak-core-spi classes.

### Changed

- Added overload with default implementation for ProgressCheck.importedPath() that accepts new PathAction enumerator type. Other signature now deprecated.
- Moved Violation.Severity enumerator to top-level type because 1) I wanted to and 2) the API extraction made this a convenient time to do it.
- JSON Config keys are now managed in child interface types with @ProviderType annotations to avoid major version bumps when adding config constants.

## [1.5.2] - 2020-04-15

### Added
- #38 modified pom to upload cli dist binaries to releases.
- #39 add --no-hooks cli option

### Fixed
- #50 Provide CLI dist with Windows binary launcher
- ExpectAces ACE criteria now correctly trims around parameter names
- #51 copied InstallHookPolicy details to scan goal doc
- #35 copied InstallHookPolicy details to scan goal doc
- #37 switched to jar checksums for opear cache folder names.

## [1.5.1] - 2019-10-03
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ADD . /app
WORKDIR /app
RUN mvn clean install -pl testing,core,cli

FROM adoptopenjdk/openjdk11-openj9:alpine-slim
FROM adoptopenjdk/openjdk14-openj9:alpine-slim
RUN mkdir -p /app/oakpal-cli
COPY --from=build /app/cli/target/oakpal-cli-*-dist.tar.gz /app
RUN tar --strip-components 1 -C /app/oakpal-cli -zxf /app/oakpal-cli-*-dist.tar.gz \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ OakPAL was designed to fill this gap, by providing:
2. An OakMachine class with a fluent Builder API that encapsulates the creation of a fresh Oak
repository, state initialization, and package installation for every set of package files.

3. A pluggable listener API with classpath discovery of third-party [Checklists](https://github.com/adamcin/oakpal/blob/master/core/src/main/resources/OAKPAL-INF/checklists/basic.json),
[ProgressChecks](oakpal-core/apidocs/net/adamcin/oakpal/core/ProgressCheck.html), and [ScriptProgressChecks](oakpal-maven-plugin/writing-a-script-check.html),
3. A pluggable listener API with classpath discovery of third-party [Checklists](https://github.com/adamcin/oakpal/blob/master/checks/src/main/resources/OAKPAL-INF/checklists/basic.json),
[ProgressChecks](net.adamcin.oakpal.api/apidocs/net/adamcin/oakpal/api/ProgressCheck.html), and [ScriptProgressChecks](oakpal-maven-plugin/writing-a-script-check.html),
which receive progress tracker events along with read-only access to incremental repository state, and which can report Violations at the end of a scan.


Expand Down
4 changes: 4 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# net.adamcin.oakpal.api

This is the API dependency for use by progress check implementers.

184 changes: 184 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 Mark Adamcin
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<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>net.adamcin.oakpal</groupId>
<artifactId>oakpal</artifactId>
<version>2.0.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>oakpal-api</artifactId>
<packaging>jar</packaging>

<name>OakPAL - API bundle</name>
<description>OakPAL API bundle</description>

<inceptionYear>2017</inceptionYear>

<scm>
<url>https://github.com/adamcin/oakpal</url>
<developerConnection>scm:git:git@github.com:adamcin/oakpal.git</developerConnection>
<connection>scm:git://github.com/adamcin/oakpal.git</connection>
<tag>HEAD</tag>
</scm>

<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>false</filtering>
</testResource>
<testResource>
<directory>src/test/filtered-resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-test-packages</id>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<bnd><![CDATA[
Bundle-SymbolicName: net.adamcin.oakpal.api
Automatic-Module-Name: net.adamcin.oakpal.api
Export-Package: net.adamcin.oakpal.api
Import-Package: *
]]></bnd>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-baseline-maven-plugin</artifactId>
<executions>
<execution>
<id>baseline</id>
<goals>
<goal>baseline</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation.versioning</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit.vault</groupId>
<artifactId>org.apache.jackrabbit.vault</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-jackrabbit-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.johnzon</artifactId>
</dependency>
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.adamcin.oakpal</groupId>
<artifactId>oakpal-testing</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit-addons</groupId>
<artifactId>junit-addons</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
64 changes: 64 additions & 0 deletions api/src/main/java/net/adamcin/oakpal/api/ApiConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright 2020 Mark Adamcin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package net.adamcin.oakpal.api;

import org.jetbrains.annotations.NotNull;
import org.osgi.annotation.versioning.ProviderType;

/**
* Hosts constants as static singleton getter methods defined by interfaces. This reduces the impact on semantic
* versioning rules of adding or modifying interface constants.
*/
public final class ApiConstants {
private ApiConstants() {
/* no construction */
}

private static final ViolationKeys VIOLATION_KEYS = new ViolationKeys() {
@Override
public String description() {
return "description";
}

@Override
public String severity() {
return "severity";
}

@Override
public String packages() {
return "packages";
}
};

/**
* Json key constant accessors for violations.
*/
@ProviderType
public interface ViolationKeys {
String description();

String severity();

String packages();
}

@NotNull
public static ViolationKeys violationKeys() {
return VIOLATION_KEYS;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019 Mark Adamcin
* Copyright 2020 Mark Adamcin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package net.adamcin.oakpal.core;
package net.adamcin.oakpal.api;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -855,8 +855,7 @@ private FunRuntimeException(final @NotNull Throwable cause) {
final @Nullable BiConsumer<? super T, ? super Exception> onError) {
final BiConsumer<? super T, ? super Exception> consumeError = onError != null
? onError
: (e, t) -> {
};
: (e, t) -> { /* do nothing */ };

return element -> {
try {
Expand Down
Loading

0 comments on commit 578e8de

Please sign in to comment.