diff options
author | Igor Fedorenko | 2013-10-09 10:10:41 +0000 |
---|---|---|
committer | Igor Fedorenko | 2013-10-09 10:55:20 +0000 |
commit | 36e6053cf2093706c034982c06766afcb74a35b8 (patch) | |
tree | 372faa74da895bb99535772b11d266ab884bb5bb /m2e-maven-runtime | |
parent | a9a6c841e0fa5f648e284c32919c0066a9d58c74 (diff) | |
download | m2e-core-36e6053cf2093706c034982c06766afcb74a35b8.tar.gz m2e-core-36e6053cf2093706c034982c06766afcb74a35b8.tar.xz m2e-core-36e6053cf2093706c034982c06766afcb74a35b8.zip |
418790 slf4j implementation for run-as maven
Maven 3.1.1 uses SLF4J for all logging and there is absolutely no
build progress feedback unless if no configure SLF4J implementation
is available on classpath.
This commit adds slf4j-simple and corresponding configuration that
match what is used by Maven on command line.
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'm2e-maven-runtime')
6 files changed, 126 insertions, 1 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> |