Skip to content

Commit

Permalink
Merge 798d994 into 1e674c6
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcin committed Sep 2, 2020
2 parents 1e674c6 + 798d994 commit 9f085db
Show file tree
Hide file tree
Showing 17 changed files with 552 additions and 87 deletions.
4 changes: 0 additions & 4 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@
</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>
Expand Down
4 changes: 0 additions & 4 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@
</testResources>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
48 changes: 40 additions & 8 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
~ 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">
<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>
Expand Down Expand Up @@ -64,10 +65,6 @@
</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>
Expand All @@ -93,7 +90,11 @@
Private-Package: net.adamcin.oakpal.core.jcrfacade.*
Import-Package: !aQute.*,\
!org.apache.sling.jcr.repoinit.*,\
!org.apache.sling.installer.api.*,\
!org.apache.felix.cm.file,\
!org.apache.felix.configurator.*\
!org.osgi.util.function.*\
!org.osgi.util.converter.*\
*
]]></bnd>
</configuration>
Expand Down Expand Up @@ -137,6 +138,7 @@
<include>biz.aQute.bnd:bndlib</include>
<include>org.apache.sling:org.apache.sling.jcr.repoinit</include>
<include>org.apache.sling:org.apache.sling.installer.core</include>
<include>org.osgi:org.apache.felix.converter</include>
</includes>
</artifactSet>
<filters>
Expand All @@ -157,15 +159,24 @@
<artifact>org.apache.sling:org.apache.sling.jcr.repoinit</artifact>
<includes>
<include>org/apache/sling/jcr/repoinit/**</include>
</includes>
</filter>
</includes>
</filter>
<filter>
<artifact>org.apache.sling:org.apache.sling.installer.core</artifact>
<includes>
<include>org/apache/felix/cm/file/ConfigurationHandler*</include>
<include>org/apache/felix/configurator/impl/json/**</include>
<include>org/apache/felix/configurator/impl/model/**</include>
<include>org/apache/sling/installer/api/InstallableResource*</include>
</includes>
</filter>
<filter>
<artifact>org.apache.felix:org.apache.felix.converter</artifact>
<includes>
<include>org/osgi/util/converter/**</include>
<include>org/osgi/util/function/**</include>
</includes>
</filter>
</filters>
<relocations>
<relocation>
Expand All @@ -174,12 +185,20 @@
</relocation>
<relocation>
<pattern>org.apache.sling.jcr.repoinit</pattern>
<shadedPattern>net.adamcin.oakpal.shaded.repoinit</shadedPattern>
<shadedPattern>net.adamcin.oakpal.shaded.sling.jcr.repoinit</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.felix</pattern>
<shadedPattern>net.adamcin.oakpal.shaded.felix</shadedPattern>
</relocation>
<relocation>
<pattern>org.osgi.util.function</pattern>
<shadedPattern>net.adamcin.oakpal.shaded.osgi.util.function</shadedPattern>
</relocation>
<relocation>
<pattern>org.osgi.util.converter</pattern>
<shadedPattern>net.adamcin.oakpal.shaded.osgi.util.converter</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.sling.installer</pattern>
<shadedPattern>net.adamcin.oakpal.shaded.sling.installer</shadedPattern>
Expand Down Expand Up @@ -272,6 +291,19 @@
<version>3.9.0</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.converter</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.util.function</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,14 @@ public void onSlingRepoInitScriptsError(Throwable error, List<String> scripts, S
LOGGER.trace("[onSlingRepoInitScriptsError] stack trace for: " + message, error);
reportViolation(new SimpleViolation(Severity.MAJOR, message));
}

@Override
public void onSlingCreateInstallableError(final Exception error,
final Class<? extends SlingInstallable> installableType,
final PackageId parentId, final String jcrPath) {
final String message = MessageFormat.format(getString("create sling installable error ({0}:{1}): {2} \"{3}\""),
parentId, jcrPath, error.getClass().getName(), error.getMessage());
LOGGER.trace("[onSlingCreateInstallableError] stack trace for: " + message, error);
reportViolation(new SimpleViolation(Severity.MAJOR, message));
}
}
16 changes: 16 additions & 0 deletions core/src/main/java/net/adamcin/oakpal/core/ErrorListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,20 @@ default void onSlingEmbeddedPackageError(final Throwable error,
final EmbeddedPackageInstallable installable) {

}

/**
* Called for errors occurring during an attempt to create an installable from a node submitted to a
* {@link net.adamcin.oakpal.api.SlingSimulator}, such as parsing errors for OSGi Config files.
*
* @param error the error thrown
* @param installableType the installable type creation that was attempted
* @param parentId the parent package ID
* @param jcrPath the jcr path
*/
default void onSlingCreateInstallableError(final Exception error,
final Class<? extends SlingInstallable> installableType,
final PackageId parentId,
final String jcrPath) {

}
}
Loading

0 comments on commit 9f085db

Please sign in to comment.