From edc9391a597233723f2ed160290c74d11729f0aa Mon Sep 17 00:00:00 2001 From: rymsha Date: Fri, 18 Oct 2019 11:49:03 +0200 Subject: [PATCH 1/5] Update Apache Felix to version 6.0.3 #7374 --- gradle/java.gradle | 2 +- modules/launcher/launcher-impl/build.gradle | 4 +--- modules/runtime/build.gradle | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gradle/java.gradle b/gradle/java.gradle index 2a6879fd152..6934741951a 100644 --- a/gradle/java.gradle +++ b/gradle/java.gradle @@ -18,7 +18,7 @@ configurations { } ext { - felixVersion = '6.0.1' + felixVersion = '6.0.3' jettyVersion = '9.4.21.v20190926' } diff --git a/modules/launcher/launcher-impl/build.gradle b/modules/launcher/launcher-impl/build.gradle index 8d9839b3672..e90fb0df923 100644 --- a/modules/launcher/launcher-impl/build.gradle +++ b/modules/launcher/launcher-impl/build.gradle @@ -3,9 +3,7 @@ dependencies { compile 'org.osgi:osgi.core:7.0.0' compile 'org.osgi:osgi.cmpn:7.0.0' compile "org.apache.felix:org.apache.felix.framework:${felixVersion}" - compile( 'org.apache.felix:org.apache.felix.utils:1.11.0' ) { - transitive = false - } + compile 'org.apache.felix:org.apache.felix.utils:1.11.2' compile 'commons-io:commons-io:2.4' compile 'ch.qos.logback:logback-classic:1.2.3' compile 'org.slf4j:jul-to-slf4j:1.7.25' diff --git a/modules/runtime/build.gradle b/modules/runtime/build.gradle index b53ff829365..bb9524dd432 100644 --- a/modules/runtime/build.gradle +++ b/modules/runtime/build.gradle @@ -22,10 +22,10 @@ addBundle( 'com.sun.xml.bind:jaxb-core:2.2.11', 4 ) addBundle( 'com.sun.xml.bind:jaxb-impl:2.2.11', 4 ) // Core bundles -addBundle( 'org.apache.felix:org.apache.felix.metatype:1.1.2', 5 ) -addBundle( 'org.apache.felix:org.apache.felix.eventadmin:1.4.4', 5 ) -addBundle( 'org.apache.felix:org.apache.felix.configadmin:1.8.8', 5 ) -addBundle( 'org.apache.felix:org.apache.felix.scr:2.0.2', 5 ) +addBundle( 'org.apache.felix:org.apache.felix.metatype:1.2.2', 5 ) +addBundle( 'org.apache.felix:org.apache.felix.eventadmin:1.5.0', 5 ) +addBundle( 'org.apache.felix:org.apache.felix.configadmin:1.9.16', 5 ) +addBundle( 'org.apache.felix:org.apache.felix.scr:2.1.16', 5 ) addBundle( 'org.slf4j:slf4j-api:1.7.25', 5 ) addBundle( 'ch.qos.logback:logback-core:1.2.3', 5 ) From d35bb125258864f80fb19c95d56a5edb4856d2b3 Mon Sep 17 00:00:00 2001 From: Sergey Rymsha Date: Thu, 24 Oct 2019 14:42:31 +0200 Subject: [PATCH 2/5] Use Osgi 7 for compilation as well. Use Felix Logging as our custom one does not work with OSGi 7 --- buildSrc/build.gradle | 2 +- modules/core/core-api/build.gradle | 4 +- modules/launcher/launcher-impl/build.gradle | 6 +- .../enonic/xp/launcher/impl/LauncherImpl.java | 16 --- .../launcher/impl/logging/LogActivator.java | 23 ---- .../impl/logging/LogConfigurator.java | 64 ----------- .../impl/logging/LogServiceFactory.java | 24 ----- .../launcher/impl/logging/LogServiceImpl.java | 101 ------------------ .../impl/logging/LogActivatorTest.java | 30 ------ .../impl/logging/LogConfiguratorTest.java | 63 ----------- .../impl/logging/LogServiceFactoryTest.java | 32 ------ .../impl/logging/LogServiceImplTest.java | 48 --------- modules/runtime/build.gradle | 6 +- 13 files changed, 8 insertions(+), 411 deletions(-) delete mode 100644 modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogActivator.java delete mode 100644 modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogConfigurator.java delete mode 100644 modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogServiceFactory.java delete mode 100644 modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogServiceImpl.java delete mode 100644 modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogActivatorTest.java delete mode 100644 modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogConfiguratorTest.java delete mode 100644 modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogServiceFactoryTest.java delete mode 100644 modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogServiceImplTest.java diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index d440097b265..f942e189aaa 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -11,7 +11,7 @@ repositories { } dependencies { - compile 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0' + compile 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.0' compile 'com.moowork.gradle:gradle-node-plugin:1.0.1' compile 'org.eclipse.jgit:org.eclipse.jgit:3.7.0.201502260915-r' compile 'com.gradle.publish:plugin-publish-plugin:0.9.3' diff --git a/modules/core/core-api/build.gradle b/modules/core/core-api/build.gradle index 500bd44b973..c66b80c3d51 100644 --- a/modules/core/core-api/build.gradle +++ b/modules/core/core-api/build.gradle @@ -7,8 +7,8 @@ dependencies { compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6' compile 'org.jparsec:jparsec:3.1' compile 'commons-io:commons-io:2.4' - compile 'org.osgi:osgi.core:6.0.0' - compile 'org.osgi:osgi.cmpn:6.0.0' + compile 'org.osgi:osgi.core:7.0.0' + compile 'org.osgi:osgi.cmpn:7.0.0' compile 'org.slf4j:slf4j-api:1.7.25' compile 'javax.mail:mail:1.4.7' compile 'io.dropwizard.metrics:metrics-core:3.1.2' diff --git a/modules/launcher/launcher-impl/build.gradle b/modules/launcher/launcher-impl/build.gradle index e90fb0df923..22cf60b2c51 100644 --- a/modules/launcher/launcher-impl/build.gradle +++ b/modules/launcher/launcher-impl/build.gradle @@ -3,12 +3,12 @@ dependencies { compile 'org.osgi:osgi.core:7.0.0' compile 'org.osgi:osgi.cmpn:7.0.0' compile "org.apache.felix:org.apache.felix.framework:${felixVersion}" + runtime 'org.apache.felix:org.apache.felix.log:1.2.2' + runtime 'org.apache.felix:org.apache.felix.logback:1.0.2' compile 'org.apache.felix:org.apache.felix.utils:1.11.2' compile 'commons-io:commons-io:2.4' compile 'ch.qos.logback:logback-classic:1.2.3' - compile 'org.slf4j:jul-to-slf4j:1.7.25' - compile 'org.slf4j:jcl-over-slf4j:1.7.25' - compile 'org.slf4j:log4j-over-slf4j:1.7.25' + compile 'org.slf4j:slf4j-api:1.7.25' compile 'org.fusesource.jansi:jansi:1.11' compile 'javax.mail:mail:1.4.7' } diff --git a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/LauncherImpl.java b/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/LauncherImpl.java index 102b727ba62..fbb7d1875a8 100644 --- a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/LauncherImpl.java +++ b/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/LauncherImpl.java @@ -13,8 +13,6 @@ import com.enonic.xp.launcher.impl.env.RequirementChecker; import com.enonic.xp.launcher.impl.env.SystemProperties; import com.enonic.xp.launcher.impl.framework.FrameworkService; -import com.enonic.xp.launcher.impl.logging.LogActivator; -import com.enonic.xp.launcher.impl.logging.LogConfigurator; import com.enonic.xp.launcher.impl.provision.ProvisionActivator; import com.enonic.xp.launcher.impl.util.BannerPrinter; @@ -82,28 +80,15 @@ private void applyConfigToSystemProperties() } } - private void setupLogging() - { - final LogConfigurator configurator = new LogConfigurator( this.env ); - configurator.configure(); - } - private void createFramework() { this.framework = new FrameworkService(); this.framework.listener( this.listener ); this.framework.config( this.config ); - addLogActivator(); addProvisionActivator(); } - private void addLogActivator() - { - final LogActivator activator = new LogActivator(); - this.framework.activator( activator ); - } - private void addProvisionActivator() { final File systemDir = new File( this.env.getInstallDir(), "system" ); @@ -117,7 +102,6 @@ public void start() { resolveEnv(); printBanner(); - setupLogging(); loadConfiguration(); applyConfigToSystemProperties(); createFramework(); diff --git a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogActivator.java b/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogActivator.java deleted file mode 100644 index 3c97de412da..00000000000 --- a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogActivator.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.enonic.xp.launcher.impl.logging; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.service.log.LogService; - -public final class LogActivator - implements BundleActivator -{ - @Override - public void start( final BundleContext context ) - throws Exception - { - context.registerService( LogService.class.getName(), LogServiceFactory.INSTANCE, null ); - } - - @Override - public void stop( final BundleContext context ) - throws Exception - { - // Do nothing - } -} diff --git a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogConfigurator.java b/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogConfigurator.java deleted file mode 100644 index 970711971e6..00000000000 --- a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogConfigurator.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.enonic.xp.launcher.impl.logging; - -import java.io.File; - -import org.slf4j.LoggerFactory; -import org.slf4j.bridge.SLF4JBridgeHandler; - -import ch.qos.logback.classic.LoggerContext; -import ch.qos.logback.classic.joran.JoranConfigurator; -import ch.qos.logback.core.util.StatusPrinter; - -import com.enonic.xp.launcher.impl.env.Environment; - -public final class LogConfigurator -{ - private final Environment env; - - public LogConfigurator( final Environment env ) - { - this.env = env; - } - - public void configure() - { - SLF4JBridgeHandler.install(); - - final File configFile = getConfigFile(); - if ( configFile.isFile() ) - { - configure( configFile ); - } - } - - private File getConfigFile() - { - final File configDir = new File( this.env.getHomeDir(), "config" ); - return new File( configDir, "logback.xml" ); - } - - private void configure( final File file ) - { - final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); - - try - { - doConfigure( context, file ); - } - catch ( final Exception e ) - { - // StatusPrinter will handle this - } - - StatusPrinter.printInCaseOfErrorsOrWarnings( context ); - } - - private void doConfigure( final LoggerContext context, final File file ) - throws Exception - { - final JoranConfigurator configurator = new JoranConfigurator(); - configurator.setContext( context ); - context.reset(); - configurator.doConfigure( file ); - } -} diff --git a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogServiceFactory.java b/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogServiceFactory.java deleted file mode 100644 index 7f38a84a45c..00000000000 --- a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogServiceFactory.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.enonic.xp.launcher.impl.logging; - -import org.osgi.framework.Bundle; -import org.osgi.framework.ServiceFactory; -import org.osgi.framework.ServiceRegistration; -import org.osgi.service.log.LogService; - -final class LogServiceFactory - implements ServiceFactory -{ - public final static LogServiceFactory INSTANCE = new LogServiceFactory(); - - @Override - public LogService getService( final Bundle bundle, final ServiceRegistration reg ) - { - return new LogServiceImpl( bundle ); - } - - @Override - public void ungetService( final Bundle bundle, final ServiceRegistration reg, final LogService service ) - { - // Do nothing - } -} diff --git a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogServiceImpl.java b/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogServiceImpl.java deleted file mode 100644 index bd41fd696c4..00000000000 --- a/modules/launcher/launcher-impl/src/main/java/com/enonic/xp/launcher/impl/logging/LogServiceImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.enonic.xp.launcher.impl.logging; - -import org.osgi.framework.Bundle; -import org.osgi.framework.ServiceReference; -import org.osgi.service.log.LogService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -final class LogServiceImpl - implements LogService -{ - private final Logger logger; - - LogServiceImpl( final Bundle bundle ) - { - this.logger = LoggerFactory.getLogger( bundle.getSymbolicName() ); - } - - @Override - public void log( final int level, final String message ) - { - switch ( level ) - { - case LogService.LOG_DEBUG: - this.logger.debug( message ); - break; - case LogService.LOG_INFO: - this.logger.info( message ); - break; - case LogService.LOG_WARNING: - this.logger.warn( message ); - break; - case LogService.LOG_ERROR: - this.logger.error( message ); - break; - } - } - - @Override - public void log( final int level, final String message, final Throwable cause ) - { - switch ( level ) - { - case LogService.LOG_DEBUG: - this.logger.debug( message, cause ); - break; - case LogService.LOG_INFO: - this.logger.info( message, cause ); - break; - case LogService.LOG_WARNING: - this.logger.warn( message, cause ); - break; - case LogService.LOG_ERROR: - this.logger.error( message, cause ); - break; - } - } - - @Override - public void log( final ServiceReference ref, final int level, final String message ) - { - log( level, message ); - } - - @Override - public void log( final ServiceReference ref, final int level, final String message, final Throwable cause ) - { - log( level, message, cause ); - } - - //TODO Java10 - @Override - public org.osgi.service.log.Logger getLogger( final String name ) - { - return null; - } - - @Override - public org.osgi.service.log.Logger getLogger( final Class clazz ) - { - return null; - } - - @Override - public L getLogger( final String name, final Class loggerType ) - { - return null; - } - - @Override - public L getLogger( final Class clazz, final Class loggerType ) - { - return null; - } - - @Override - public L getLogger( final Bundle bundle, final String name, final Class loggerType ) - { - return null; - } -} diff --git a/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogActivatorTest.java b/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogActivatorTest.java deleted file mode 100644 index 34d89049d12..00000000000 --- a/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogActivatorTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.enonic.xp.launcher.impl.logging; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; -import org.osgi.framework.BundleContext; -import org.osgi.service.log.LogService; - -public class LogActivatorTest -{ - private LogActivator activator; - - @BeforeEach - public void setup() - { - this.activator = new LogActivator(); - } - - @Test - public void testLifecycle() - throws Exception - { - final BundleContext context = Mockito.mock( BundleContext.class ); - this.activator.start( context ); - - Mockito.verify( context, Mockito.times( 1 ) ).registerService( LogService.class.getName(), LogServiceFactory.INSTANCE, null ); - - this.activator.stop( context ); - } -} diff --git a/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogConfiguratorTest.java b/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogConfiguratorTest.java deleted file mode 100644 index 873198436e9..00000000000 --- a/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogConfiguratorTest.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.enonic.xp.launcher.impl.logging; - -import java.io.File; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import org.mockito.Mockito; - -import com.enonic.xp.launcher.impl.env.Environment; - -public class LogConfiguratorTest -{ - @TempDir - public Path temporaryFolder; - - private Environment env; - - @BeforeEach - public void setup() - { - this.env = Mockito.mock( Environment.class ); - Mockito.when( this.env.getHomeDir() ).thenReturn( this.temporaryFolder.toFile() ); - } - - private void writeLogbackFile( final String xml ) - throws Exception - { - final File configDir = Files.createDirectory(this.temporaryFolder.resolve( "config" ) ).toFile(); - final File logbackFile = new File( configDir, "logback.xml" ); - com.google.common.io.Files.write( xml, logbackFile, StandardCharsets.UTF_8 ); - } - - @Test - public void testConfigurator() - throws Exception - { - writeLogbackFile( "" ); - - final LogConfigurator configurator = new LogConfigurator( this.env ); - configurator.configure(); - } - - @Test - public void testConfigurator_error() - throws Exception - { - writeLogbackFile( "" ); - - final LogConfigurator configurator = new LogConfigurator( this.env ); - configurator.configure(); - } - - @Test - public void testConfigurator_wrongFile() - { - final LogConfigurator configurator = new LogConfigurator( this.env ); - configurator.configure(); - } -} diff --git a/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogServiceFactoryTest.java b/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogServiceFactoryTest.java deleted file mode 100644 index 16efc7c10d6..00000000000 --- a/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogServiceFactoryTest.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.enonic.xp.launcher.impl.logging; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; -import org.osgi.framework.Bundle; -import org.osgi.service.log.LogService; - -import static org.junit.jupiter.api.Assertions.assertNotNull; - -public class LogServiceFactoryTest -{ - private LogServiceFactory factory; - - @BeforeEach - public void setup() - { - this.factory = LogServiceFactory.INSTANCE; - } - - @Test - public void testGetAndUnGet() - { - final Bundle bundle = Mockito.mock( Bundle.class ); - Mockito.when( bundle.getSymbolicName() ).thenReturn( "foo.bar" ); - - final LogService service = this.factory.getService( bundle, null ); - assertNotNull( service ); - - this.factory.ungetService( bundle, null, service ); - } -} diff --git a/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogServiceImplTest.java b/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogServiceImplTest.java deleted file mode 100644 index 7440efea9f7..00000000000 --- a/modules/launcher/launcher-impl/src/test/java/com/enonic/xp/launcher/impl/logging/LogServiceImplTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.enonic.xp.launcher.impl.logging; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; -import org.osgi.framework.Bundle; -import org.osgi.service.log.LogService; - -public class LogServiceImplTest -{ - private LogServiceImpl service; - - @BeforeEach - public void setup() - { - final Bundle bundle = Mockito.mock( Bundle.class ); - Mockito.when( bundle.getSymbolicName() ).thenReturn( "foo.bar" ); - - this.service = new LogServiceImpl( bundle ); - } - - @Test - public void testLog() - { - this.service.log( LogService.LOG_DEBUG, "test" ); - this.service.log( LogService.LOG_INFO, "test" ); - this.service.log( LogService.LOG_WARNING, "test" ); - this.service.log( LogService.LOG_ERROR, "test" ); - this.service.log( -1, "test" ); - } - - @Test - public void testLog_withCause() - { - this.service.log( LogService.LOG_DEBUG, "test", new Throwable() ); - this.service.log( LogService.LOG_INFO, "test", new Throwable() ); - this.service.log( LogService.LOG_WARNING, "test", new Throwable() ); - this.service.log( LogService.LOG_ERROR, "test", new Throwable() ); - this.service.log( -1, "test", new Throwable() ); - } - - @Test - public void testLog_ref() - { - this.service.log( null, LogService.LOG_DEBUG, "test" ); - this.service.log( null, LogService.LOG_DEBUG, "test", new Throwable() ); - } -} diff --git a/modules/runtime/build.gradle b/modules/runtime/build.gradle index bb9524dd432..6ced66a2ec3 100644 --- a/modules/runtime/build.gradle +++ b/modules/runtime/build.gradle @@ -26,11 +26,10 @@ addBundle( 'org.apache.felix:org.apache.felix.metatype:1.2.2', 5 ) addBundle( 'org.apache.felix:org.apache.felix.eventadmin:1.5.0', 5 ) addBundle( 'org.apache.felix:org.apache.felix.configadmin:1.9.16', 5 ) addBundle( 'org.apache.felix:org.apache.felix.scr:2.1.16', 5 ) +addBundle( 'org.osgi:org.osgi.util.promise:1.1.1', 5 ) +addBundle( 'org.osgi:org.osgi.util.function:1.1.0', 5 ) addBundle( 'org.slf4j:slf4j-api:1.7.25', 5 ) -addBundle( 'ch.qos.logback:logback-core:1.2.3', 5 ) -addBundle( 'ch.qos.logback:logback-classic:1.2.3', 5 ) -addBundle( 'org.slf4j:jul-to-slf4j:1.7.25', 5 ) addBundle( 'org.slf4j:jcl-over-slf4j:1.7.25', 5 ) addBundle( 'org.slf4j:log4j-over-slf4j:1.7.25', 5 ) @@ -46,7 +45,6 @@ addBundle( 'net.java.dev.jna:jna:4.1.0', 6) addBundle( 'com.google.guava:guava:26.0-jre', 8 ) addBundle( 'commons-lang:commons-lang:2.4', 8 ) addBundle( 'commons-io:commons-io:2.4', 8 ) -addBundle( 'commons-io:commons-io:2.4', 8 ) addBundle( 'org.apache.commons:commons-compress:1.14', 8 ) addBundle( 'com.fasterxml.jackson.core:jackson-core:2.9.6', 8 ) addBundle( 'com.fasterxml.jackson.core:jackson-annotations:2.9.6', 8 ) From b9a21c59cb93018178541998fe52657bb06fcf5c Mon Sep 17 00:00:00 2001 From: Sergey Rymsha Date: Thu, 24 Oct 2019 15:10:55 +0200 Subject: [PATCH 3/5] fix tests --- .../xp/web/impl/dispatch/DispatchServletImplTest.java | 9 +++++++++ .../impl/dispatch/pipeline/ResourcePipelineImplTest.java | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/modules/web/web-dispatch/src/test/java/com/enonic/xp/web/impl/dispatch/DispatchServletImplTest.java b/modules/web/web-dispatch/src/test/java/com/enonic/xp/web/impl/dispatch/DispatchServletImplTest.java index 5549e5d26dc..42303b4dbf9 100644 --- a/modules/web/web-dispatch/src/test/java/com/enonic/xp/web/impl/dispatch/DispatchServletImplTest.java +++ b/modules/web/web-dispatch/src/test/java/com/enonic/xp/web/impl/dispatch/DispatchServletImplTest.java @@ -1,5 +1,8 @@ package com.enonic.xp.web.impl.dispatch; +import java.util.Dictionary; +import java.util.Hashtable; + import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -105,5 +108,11 @@ public int compareTo( final Object reference ) { return 0; } + + @Override + public Dictionary getProperties() + { + return new Hashtable<>(); + } } } diff --git a/modules/web/web-dispatch/src/test/java/com/enonic/xp/web/impl/dispatch/pipeline/ResourcePipelineImplTest.java b/modules/web/web-dispatch/src/test/java/com/enonic/xp/web/impl/dispatch/pipeline/ResourcePipelineImplTest.java index 4f771b6b638..aa092a3a856 100644 --- a/modules/web/web-dispatch/src/test/java/com/enonic/xp/web/impl/dispatch/pipeline/ResourcePipelineImplTest.java +++ b/modules/web/web-dispatch/src/test/java/com/enonic/xp/web/impl/dispatch/pipeline/ResourcePipelineImplTest.java @@ -1,6 +1,8 @@ package com.enonic.xp.web.impl.dispatch.pipeline; +import java.util.Dictionary; import java.util.HashMap; +import java.util.Hashtable; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -116,5 +118,11 @@ public int compareTo( final Object reference ) { return 0; } + + @Override + public Dictionary getProperties() + { + return new Hashtable<>(); + } } } From e3e1902168dd16ef22130fb924a05d12e70c6101 Mon Sep 17 00:00:00 2001 From: Sergey Rymsha Date: Thu, 24 Oct 2019 16:35:27 +0200 Subject: [PATCH 4/5] path to logback.xml via system property must be provided --- .../src/main/resources/META-INF/config/system.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/launcher/launcher-impl/src/main/resources/META-INF/config/system.properties b/modules/launcher/launcher-impl/src/main/resources/META-INF/config/system.properties index f9b0d69757d..06e5410ef2a 100644 --- a/modules/launcher/launcher-impl/src/main/resources/META-INF/config/system.properties +++ b/modules/launcher/launcher-impl/src/main/resources/META-INF/config/system.properties @@ -16,6 +16,7 @@ xp.osgi.startlevel.bundle = 60 # Log settings # felix.log.level = 1 +logback.configurationFile=${xp.home}/config/logback.xml # # Configuration FileMonitor properties From ae8e9db180386f110b7bfb4f3ad9612294ccf5c8 Mon Sep 17 00:00:00 2001 From: rymsha Date: Fri, 25 Oct 2019 13:31:05 +0200 Subject: [PATCH 5/5] Polish dependencies for #7374 --- modules/launcher/launcher-impl/build.gradle | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/launcher/launcher-impl/build.gradle b/modules/launcher/launcher-impl/build.gradle index 22cf60b2c51..97dc67a1188 100644 --- a/modules/launcher/launcher-impl/build.gradle +++ b/modules/launcher/launcher-impl/build.gradle @@ -3,11 +3,10 @@ dependencies { compile 'org.osgi:osgi.core:7.0.0' compile 'org.osgi:osgi.cmpn:7.0.0' compile "org.apache.felix:org.apache.felix.framework:${felixVersion}" - runtime 'org.apache.felix:org.apache.felix.log:1.2.2' - runtime 'org.apache.felix:org.apache.felix.logback:1.0.2' + runtimeOnly 'org.apache.felix:org.apache.felix.logback:1.0.2' compile 'org.apache.felix:org.apache.felix.utils:1.11.2' compile 'commons-io:commons-io:2.4' - compile 'ch.qos.logback:logback-classic:1.2.3' + runtimeOnly 'ch.qos.logback:logback-classic:1.2.3' compile 'org.slf4j:slf4j-api:1.7.25' compile 'org.fusesource.jansi:jansi:1.11' compile 'javax.mail:mail:1.4.7'