vy commented on issue #1896:
URL: 
https://github.com/apache/logging-log4j2/issues/1896#issuecomment-1778892955

   @CodeDead, thank you so much for taking time to provide `sample-log4j2`! 
:heart_eyes: It certainly helped for troubleshooting!
   
   I have pushed ca225f0e7a442c5646351a2042a7721f2921b740 addressing your 
issue, [the 
build](https://github.com/apache/logging-log4j2/actions/runs/6638069559) should 
have successfully completed as you read this. This `2.22.0-SNAPSHOT` version 
works against the `sample-log4j2` where the `forceMerge('log4j-api')` line and 
the `mergedModule { ... }` block in `build.gradle` is commented out – I don't 
think you should be needing/doing any of these.
   
   ```
   $ git diff
   warning: CRLF will be replaced by LF in gradlew.bat.
   The file will have its original line endings in your working directory
   diff --git a/build.gradle b/build.gradle
   index a703f21..22e113f 100644
   --- a/build.gradle
   +++ b/build.gradle
   @@ -21,28 +21,28 @@ java {
    
    jlink {
        options = ['--strip-debug', '--compress', 'zip-9', '--no-header-files', 
'--no-man-pages']
   -    forceMerge('log4j-api')
   +    // forceMerge('log4j-api')
        launcher {
            name = 'Sample'
        }
    
   -    mergedModule {
   -        additive = true
   -        uses 'org.apache.logging.log4j.util.PropertySource'
   -        uses 'org.apache.logging.log4j.core.util.ContextDataProvider'
   -        uses 'org.apache.logging.log4j.core.util.WatchEventService'
   -        uses 'org.apache.logging.log4j.spi.Provider'
   -        uses 
'org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory'
   -    }
   +    // mergedModule {
   +    //     additive = true
   +    //     uses 'org.apache.logging.log4j.util.PropertySource'
   +    //     uses 'org.apache.logging.log4j.core.util.ContextDataProvider'
   +    //     uses 'org.apache.logging.log4j.core.util.WatchEventService'
   +    //     uses 'org.apache.logging.log4j.spi.Provider'
   +    //     uses 
'org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory'
   +    // }
    }
    
   -
    repositories {
   +    mavenLocal()
        mavenCentral()
    }
    
    dependencies {
   -    implementation 'org.apache.logging.log4j:log4j-core:2.20.0'
   +    implementation 'org.apache.logging.log4j:log4j-core:2.22.0-SNAPSHOT'
        testImplementation platform('org.junit:junit-bom:5.9.1')
        testImplementation 'org.junit.jupiter:junit-jupiter'
    }
   $ ./gradlew jlink
   $ build/image/bin/java -m sample.log4j.main
   WARN StatusConsoleListener JNDI lookup class is not available because this 
JRE does not support JNDI. JNDI string lookups will not be available, 
continuing configuration. Ignoring java.lang.NoClassDefFoundError: 
javax/naming/Context
   [INFO][2023-10-25 11:40:21.301][main] Main   -       Hello, World!
   ```
   
   I'd appreciate it if you can close the ticket if your problem is resolved.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to