Return-Path: Delivered-To: apmail-incubator-sling-commits-archive@locus.apache.org Received: (qmail 54280 invoked from network); 3 Oct 2007 13:22:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Oct 2007 13:22:46 -0000 Received: (qmail 64750 invoked by uid 500); 3 Oct 2007 13:22:35 -0000 Delivered-To: apmail-incubator-sling-commits-archive@incubator.apache.org Received: (qmail 64715 invoked by uid 500); 3 Oct 2007 13:22:35 -0000 Mailing-List: contact sling-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sling-dev@incubator.apache.org Delivered-To: mailing list sling-commits@incubator.apache.org Received: (qmail 64706 invoked by uid 99); 3 Oct 2007 13:22:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2007 06:22:35 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2007 13:22:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1345B1A9832; Wed, 3 Oct 2007 06:22:25 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r581593 - /incubator/sling/trunk/maven-jspc-plugin/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java Date: Wed, 03 Oct 2007 13:22:24 -0000 To: sling-commits@incubator.apache.org From: fmeschbe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071003132225.1345B1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fmeschbe Date: Wed Oct 3 06:22:24 2007 New Revision: 581593 URL: http://svn.apache.org/viewvc?rev=581593&view=rev Log: SLING-29 JspC plugin cannot create Compiler because JCL setup fails Modified: incubator/sling/trunk/maven-jspc-plugin/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java Modified: incubator/sling/trunk/maven-jspc-plugin/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java URL: http://svn.apache.org/viewvc/incubator/sling/trunk/maven-jspc-plugin/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java?rev=581593&r1=581592&r2=581593&view=diff ============================================================================== --- incubator/sling/trunk/maven-jspc-plugin/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java (original) +++ incubator/sling/trunk/maven-jspc-plugin/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java Wed Oct 3 06:22:24 2007 @@ -39,6 +39,8 @@ import javax.servlet.ServletContext; +import org.apache.commons.logging.impl.LogFactoryImpl; +import org.apache.commons.logging.impl.SimpleLog; import org.apache.jasper.JasperException; import org.apache.jasper.JspCompilationContext; import org.apache.jasper.Options; @@ -60,7 +62,7 @@ * jspc compiling JSP into the target and creating a component * descriptor for Declarative Services to use the JSP with the help of the * appropriate adapter as component. - * + * * @goal jspc * @phase compile * @description Compile JSP Files into Servlet Classes using the same JSP @@ -211,11 +213,22 @@ // scanFiles(new File(sourceDirectory)); // have the files compiled + String oldValue = System.getProperty(LogFactoryImpl.LOG_PROPERTY); try { + // ensure the JSP Compiler does not try to use Log4J + System.setProperty(LogFactoryImpl.LOG_PROPERTY, + SimpleLog.class.getName()); + executeInternal(); } catch (JasperException je) { getLog().error("Compilation Failure", je); throw new MojoExecutionException(je.getMessage(), je); + } finally { + if (oldValue == null) { + System.clearProperty(LogFactoryImpl.LOG_PROPERTY); + } else { + System.setProperty(LogFactoryImpl.LOG_PROPERTY, oldValue); + } } project.addCompileSourceRoot(outputDirectory);