Merge pull request #19 from rmannibucau/rmannibucau/enable-to-preload-configuration

enable to preload configuration
diff --git a/winegrower-core/src/main/java/org/apache/winegrower/framework/WinegrowerFramework.java b/winegrower-core/src/main/java/org/apache/winegrower/framework/WinegrowerFramework.java
index 32a2279..63c9015 100644
--- a/winegrower-core/src/main/java/org/apache/winegrower/framework/WinegrowerFramework.java
+++ b/winegrower-core/src/main/java/org/apache/winegrower/framework/WinegrowerFramework.java
@@ -59,7 +59,7 @@
     private BundleImpl frameworkBundle;
 
     public WinegrowerFramework() {
-        configuration.setLazyInstall(true);
+        configuration.setLazyInstall(!Boolean.getBoolean("winegrower.framework.lazyInstall.skip"));
     }
 
     public void setConfiguration(final Ripener.Configuration configuration) {
diff --git a/winegrower-core/src/main/java/org/apache/winegrower/scanner/manifest/OSGiCDIManifestContributor.java b/winegrower-core/src/main/java/org/apache/winegrower/scanner/manifest/OSGiCDIManifestContributor.java
index b1dd0cb..7c0f582 100644
--- a/winegrower-core/src/main/java/org/apache/winegrower/scanner/manifest/OSGiCDIManifestContributor.java
+++ b/winegrower-core/src/main/java/org/apache/winegrower/scanner/manifest/OSGiCDIManifestContributor.java
@@ -55,7 +55,7 @@
         final WinegrowerAnnotationFinder waf = WinegrowerAnnotationFinder.class.cast(finder);
         if (JarArchive.class.isInstance(archive)) {
             try (final JarFile jar = new JarFile(org.apache.xbean.finder.util.Files.toFile(JarArchive.class.cast(archive).getUrl()))) {
-                if (jar.getEntry("META-INF/beans/xml") == null) {
+                if (jar.getEntry("META-INF/beans.xml") == null) {
                     return;
                 }
                 appendOsgiCDIExtender(mf, waf);
diff --git a/winegrower-core/src/main/java/org/apache/winegrower/service/OSGiServices.java b/winegrower-core/src/main/java/org/apache/winegrower/service/OSGiServices.java
index 6bf6b26..57f7ce9 100644
--- a/winegrower-core/src/main/java/org/apache/winegrower/service/OSGiServices.java
+++ b/winegrower-core/src/main/java/org/apache/winegrower/service/OSGiServices.java
@@ -156,6 +156,12 @@
             @Override
             public Object get(final Object key) {
                 final String property = System.getProperty(String.valueOf(key));
+                if ("*".equals(property)) { // http.port for ex
+                    final Object overridenValue = super.get(key);
+                    if (overridenValue != null) {
+                        return overridenValue;
+                    }
+                }
                 return property != null ? property : super.get(key);
             }
         };
diff --git a/winegrower-extension/winegrower-testing/winegrower-testing-junit5/src/main/java/org/apache/winegrower/extension/testing/junit5/NotAnOSGiService.java b/winegrower-extension/winegrower-testing/winegrower-testing-junit5/src/main/java/org/apache/winegrower/extension/testing/junit5/NotAnOSGiService.java
new file mode 100644
index 0000000..8617539
--- /dev/null
+++ b/winegrower-extension/winegrower-testing/winegrower-testing-junit5/src/main/java/org/apache/winegrower/extension/testing/junit5/NotAnOSGiService.java
@@ -0,0 +1,28 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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 org.apache.winegrower.extension.testing.junit5;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Mark a parameter as not being injected from Winegrower extension but another one.
+ */
+@Target(PARAMETER)
+@Retention(RUNTIME)
+public @interface NotAnOSGiService {
+}
diff --git a/winegrower-extension/winegrower-testing/winegrower-testing-junit5/src/main/java/org/apache/winegrower/extension/testing/junit5/internal/BaseInjection.java b/winegrower-extension/winegrower-testing/winegrower-testing-junit5/src/main/java/org/apache/winegrower/extension/testing/junit5/internal/BaseInjection.java
index cd014b0..b083a02 100644
--- a/winegrower-extension/winegrower-testing/winegrower-testing-junit5/src/main/java/org/apache/winegrower/extension/testing/junit5/internal/BaseInjection.java
+++ b/winegrower-extension/winegrower-testing/winegrower-testing-junit5/src/main/java/org/apache/winegrower/extension/testing/junit5/internal/BaseInjection.java
@@ -16,6 +16,7 @@
 import static java.util.Optional.ofNullable;
 
 import org.apache.winegrower.Ripener;
+import org.apache.winegrower.extension.testing.junit5.NotAnOSGiService;
 import org.apache.winegrower.service.OSGiServices;
 import org.junit.jupiter.api.extension.ExtensionContext;
 import org.junit.jupiter.api.extension.ParameterContext;
@@ -23,6 +24,8 @@
 import org.junit.jupiter.api.extension.ParameterResolver;
 import org.junit.jupiter.api.extension.TestInstancePostProcessor;
 
+import java.lang.reflect.Parameter;
+
 public abstract class BaseInjection implements TestInstancePostProcessor, ParameterResolver {
     @Override
     public void postProcessTestInstance(final Object o, final ExtensionContext context) {
@@ -33,8 +36,10 @@
     @Override
     public boolean supportsParameter(final ParameterContext parameterContext, final ExtensionContext context)
             throws ParameterResolutionException {
-        final Class<?> type = parameterContext.getParameter().getType();
-        return type == Ripener.class || type == OSGiServices.class || store(context).get(Ripener.class, Ripener.class).getServices().findService(type).isPresent();
+        final Parameter parameter = parameterContext.getParameter();
+        final Class<?> type = parameter.getType();
+        return !parameter.isAnnotationPresent(NotAnOSGiService.class) &&
+                (type == Ripener.class || type == OSGiServices.class || store(context).get(Ripener.class, Ripener.class).getServices().findService(type).isPresent());
     }
 
     @Override