Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/pom.xml74
-rw-r--r--m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/OSGI-INF/l10n/bundle.properties3
-rw-r--r--m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/about_files/slf4j-simple-LICENSE.txt21
-rw-r--r--m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/simplelogger.properties25
-rw-r--r--m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml3
-rw-r--r--m2e-maven-runtime/pom.xml1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java2
-rw-r--r--org.eclipse.m2e.feature/feature.xml6
-rw-r--r--pom.xml5
9 files changed, 138 insertions, 2 deletions
diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/pom.xml
new file mode 100644
index 00000000..cbd49165
--- /dev/null
+++ b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/pom.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2013 Igor Fedorenko
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+-->
+<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>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>m2e-maven-runtime</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.m2e.maven.runtime.slf4j.simple</artifactId>
+ <packaging>bundle</packaging>
+
+ <description>
+ This bundle provides SLF4j implementation and configuration required to run m2e embedded Maven runtime
+ in external JVM. This bundle is NOT a general purpose slf4j-simple OSGi bundle, it does NOT export
+ any packages and it CANNOT be used as an OSGI SLF4J implementation.
+
+ This is suboptimal and a better solution would be to either include slf4j-simple as a resource in
+ org.eclipse.m2e.maven.runtime or use SLF4J implementation of the running m2e instance. I could not
+ find an easy way to implement either of the better solutions, so this one will have to do for now.
+
+ This bundle is referenced as Require-Bundle by org.eclipse.m2e.maven.runtime to force installation
+ of this bundle whenever m2e embedded maven runtime is installed. Because no packages are exported,
+ this does not pollute OSGi classpath. Provide-Capability/Require-Capability would be cleaner, but
+ I don't know if these are supported bu P2.
+ </description>
+
+ <properties>
+ <!-- maven core version -->
+ <slf4j-simple.version>1.7.5</slf4j-simple.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4j-simple.version}</version>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Embed-Directory>jars</Embed-Directory>
+ <Embed-Dependency>
+ slf4j-simple
+ </Embed-Dependency>
+ <Import-Package>!*</Import-Package>
+ <Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/OSGI-INF/l10n/bundle.properties b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000..7c2a53a3
--- /dev/null
+++ b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.m2e.maven.indexer
+Bundle-Vendor = Eclipse.org - m2e
+Bundle-Name = slf4j-simple for use in m2e embedded maven runtime \ No newline at end of file
diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/about_files/slf4j-simple-LICENSE.txt b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/about_files/slf4j-simple-LICENSE.txt
new file mode 100644
index 00000000..bc7fd292
--- /dev/null
+++ b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/about_files/slf4j-simple-LICENSE.txt
@@ -0,0 +1,21 @@
+Copyright (c) 2004-2013 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/simplelogger.properties b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/simplelogger.properties
new file mode 100644
index 00000000..859ff725
--- /dev/null
+++ b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/src/main/resources/simplelogger.properties
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+
+org.slf4j.simpleLogger.defaultLogLevel=info
+org.slf4j.simpleLogger.showDateTime=false
+org.slf4j.simpleLogger.showThreadName=false
+org.slf4j.simpleLogger.showLogName=false
+org.slf4j.simpleLogger.logFile=System.out
+org.slf4j.simpleLogger.levelInBrackets=true
+org.slf4j.simpleLogger.log.Sisu=info
+org.slf4j.simpleLogger.warnLevelString=WARNING \ No newline at end of file
diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml
index 3cee646c..7833a021 100644
--- a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml
+++ b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml
@@ -159,7 +159,8 @@
!*
</Import-Package>
<Require-Bundle>
- org.slf4j.api;bundle-version="1.6.2"
+ org.slf4j.api;bundle-version="1.6.2",
+ org.eclipse.m2e.maven.runtime.slf4j.simple;bundle-version="[1.5.0,1.6.0)"
</Require-Bundle>
<Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
diff --git a/m2e-maven-runtime/pom.xml b/m2e-maven-runtime/pom.xml
index 589af64c..f298c0f6 100644
--- a/m2e-maven-runtime/pom.xml
+++ b/m2e-maven-runtime/pom.xml
@@ -42,6 +42,7 @@
<module>org.eclipse.m2e.archetype.common</module>
<module>org.eclipse.m2e.maven.indexer</module>
<module>org.eclipse.m2e.maven.runtime</module>
+ <module>org.eclipse.m2e.maven.runtime.slf4j.simple</module>
</modules>
<build>
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java
index 6673cc9d..21acc128 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenEmbeddedRuntime.java
@@ -124,7 +124,7 @@ public class MavenEmbeddedRuntime implements MavenRuntime {
addBundleClasspathEntries(allentries, mavenRuntimeBundle);
// find and add more bundles
- for(String sname : new String[] {"org.slf4j.api"}) {
+ for(String sname : new String[] {"org.slf4j.api", "org.eclipse.m2e.maven.runtime.slf4j.simple"}) {
Bundle dependency = findDependencyBundle(mavenRuntimeBundle, sname, new HashSet<Bundle>());
if(dependency != null) {
addBundleClasspathEntries(allentries, dependency);
diff --git a/org.eclipse.m2e.feature/feature.xml b/org.eclipse.m2e.feature/feature.xml
index 01a19ea9..21e79c07 100644
--- a/org.eclipse.m2e.feature/feature.xml
+++ b/org.eclipse.m2e.feature/feature.xml
@@ -94,6 +94,12 @@
version="0.0.0"/>
<plugin
+ id="org.eclipse.m2e.maven.runtime.slf4j.simple"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
id="org.eclipse.m2e.refactoring"
download-size="0"
install-size="0"
diff --git a/pom.xml b/pom.xml
index 199b2777..ecfc46f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -129,6 +129,11 @@
<artifactId>org.eclipse.m2e.maven.runtime</artifactId>
<version>${m2e-maven-runtime.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>org.eclipse.m2e.maven.runtime.slf4j.simple</artifactId>
+ <version>${m2e-maven-runtime.version}</version>
+ </dependency>
</dependencies>
<build>

Back to the top