Skip to content

Commit 3dda4c9

Browse files
committed
Fix log4j and batik native configuration
1 parent c315c88 commit 3dda4c9

File tree

6 files changed

+67
-7
lines changed

6 files changed

+67
-7
lines changed

.github/workflows/pull-request-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
java --version
6868
export MAVEN_OPTS="-Xmx4096m"
6969
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
70-
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
70+
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
7171
shell: bash
7272

7373
- name: Build native image

.github/workflows/release-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
release_version=${{ github.event.inputs.release_version }}
100100
101101
# Actual build of core SDK
102-
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -DaltDeploymentRepository=local::default::file://nexus-staging -Psign
102+
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean deploy -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60 -DaltDeploymentRepository=local::default::file://nexus-staging -Psign
103103
# Build of CLI
104104
unset JAVA_TOOL_OPTIONS
105105
mvn -B -pl tools/samm-cli clean verify -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
@@ -171,7 +171,7 @@ jobs:
171171
mvn versions:set -DnewVersion=${{ github.event.inputs.release_version }}
172172
mvn versions:commit
173173
# Actual build of core SDK
174-
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
174+
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
175175
# Build of CLI
176176
unset JAVA_TOOL_OPTIONS
177177
mvn -B -pl tools/samm-cli clean verify -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
@@ -257,7 +257,7 @@ jobs:
257257
mvn versions:commit
258258
259259
# Actual build of core SDK
260-
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
260+
mvn -B -pl '!org.eclipse.esmf:samm-cli' clean install -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
261261
# Build of CLI
262262
unset JAVA_TOOL_OPTIONS
263263
mvn -B -pl tools/samm-cli clean verify -Pnative -Dmaven.wagon.httpconnectionManager.ttlSeconds=60

core/esmf-native-support/src/main/java/org/eclipse/esmf/nativefeatures/DiagramFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ private void setupBatikConfiguration() {
323323
Native.forClass( "org.apache.batik.css.parser.Parser" )
324324
.registerEverythingForReflection();
325325
Native.forClass( "org.apache.batik.ext.awt.image.codec.png.PNGTranscoderInternalCodecWriteAdapter" )
326-
.registerConstructorForReflection();
326+
.registerEverythingForReflection();
327327

328328
Native.addResource( "org/apache/batik/anim/dom/resources/UserAgentStyleSheet.css" );
329329
Native.addResource( "org/apache/batik/bridge/resources/help.gif" );

core/esmf-native-support/src/main/java/org/eclipse/esmf/nativefeatures/LogbackFeature.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,37 @@ public void beforeAnalysis( final Feature.BeforeAnalysisAccess access ) {
5555
.initializeAtBuildTime()
5656
.registerEverythingForReflection();
5757

58+
Native.forClass( org.apache.logging.log4j.spi.Provider.class )
59+
.initializeAtBuildTime();
60+
Native.forClass( org.apache.logging.log4j.util.ProviderUtil.class )
61+
.initializeAtBuildTime();
62+
Native.forClass( org.apache.logging.log4j.util.Strings.class )
63+
.initializeAtBuildTime();
64+
Native.forClass( org.apache.logging.log4j.util.Constants.class )
65+
.initializeAtBuildTime();
66+
Native.forClass( org.apache.logging.log4j.spi.AbstractLogger.class )
67+
.initializeAtBuildTime();
68+
Native.forClass( org.apache.logging.log4j.message.ReusableMessageFactory.class )
69+
.initializeAtBuildTime();
70+
Native.forClass( org.apache.logging.log4j.util.OsgiServiceLocator.class )
71+
.initializeAtBuildTime();
72+
Native.forClass( org.apache.logging.log4j.status.StatusLogger.class )
73+
.initializeAtBuildTime();
74+
Native.forClass( org.apache.logging.log4j.Level.class )
75+
.initializeAtBuildTime();
76+
Native.forClass( org.apache.logging.log4j.util.PropertiesUtil.class )
77+
.initializeAtBuildTime();
78+
Native.forClass( org.apache.logging.log4j.util.LoaderUtil.class )
79+
.initializeAtBuildTime();
80+
Native.forClass( org.apache.logging.log4j.util.PropertySource.Util.class )
81+
.initializeAtBuildTime();
82+
Native.forClass( org.apache.logging.log4j.spi.StandardLevel.class )
83+
.initializeAtBuildTime();
84+
Native.forClass( org.apache.logging.log4j.spi.LoggerRegistry.class )
85+
.initializeAtBuildTime();
86+
Native.forClass( org.apache.logging.log4j.simple.SimpleLogger.class )
87+
.initializeAtBuildTime();
88+
5889
Native.forClass( org.slf4j.LoggerFactory.class )
5990
.initializeAtBuildTime()
6091
.registerEverythingForReflection();

core/esmf-native-support/src/main/java/org/eclipse/esmf/substitution/Target_org_apache_logging_log4j_LogManager.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
package org.eclipse.esmf.substitution;
1515

16-
import org.eclipse.esmf.nativefeatures.LogbackFeature;
17-
1816
import com.oracle.svm.core.annotate.Alias;
1917
import com.oracle.svm.core.annotate.RecomputeFieldValue;
2018
import com.oracle.svm.core.annotate.TargetClass;

pom.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,4 +288,35 @@
288288
</plugin>
289289
</plugins>
290290
</build>
291+
292+
<profiles>
293+
<profile>
294+
<id>native</id>
295+
<build>
296+
<plugins>
297+
<plugin>
298+
<groupId>org.apache.maven.plugins</groupId>
299+
<artifactId>maven-surefire-plugin</artifactId>
300+
<configuration>
301+
<skip>false</skip>
302+
<argLine>-agentlib:native-image-agent=config-merge-dir=${native-config-path}</argLine>
303+
</configuration>
304+
</plugin>
305+
306+
<plugin>
307+
<groupId>org.apache.maven.plugins</groupId>
308+
<artifactId>maven-clean-plugin</artifactId>
309+
<inherited>false</inherited>
310+
<configuration>
311+
<filesets>
312+
<fileset>
313+
<directory>${relative-native-config-path}</directory>
314+
</fileset>
315+
</filesets>
316+
</configuration>
317+
</plugin>
318+
</plugins>
319+
</build>
320+
</profile>
321+
</profiles>
291322
</project>

0 commit comments

Comments
 (0)