Return-Path: Delivered-To: apmail-directory-users-archive@www.apache.org Received: (qmail 66468 invoked from network); 28 Sep 2010 16:41:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Sep 2010 16:41:05 -0000 Received: (qmail 4138 invoked by uid 500); 28 Sep 2010 16:41:04 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 4065 invoked by uid 500); 28 Sep 2010 16:41:04 -0000 Mailing-List: contact users-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@directory.apache.org Delivered-To: mailing list users@directory.apache.org Received: (qmail 4057 invoked by uid 99); 28 Sep 2010 16:41:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 16:41:03 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.215.178] (HELO mail-ey0-f178.google.com) (209.85.215.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Sep 2010 16:40:57 +0000 Received: by eyh6 with SMTP id 6so2565685eyh.37 for ; Tue, 28 Sep 2010 09:40:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.179.20 with SMTP id g20mr194129wem.45.1285692034668; Tue, 28 Sep 2010 09:40:34 -0700 (PDT) Received: by 10.216.157.208 with HTTP; Tue, 28 Sep 2010 09:40:34 -0700 (PDT) Date: Tue, 28 Sep 2010 12:40:34 -0400 Message-ID: Subject: apacheds-maven-plugin and ApacheDS 1.5.7 From: Owen Jacobson To: users@directory.apache.org Content-Type: text/plain; charset=ISO-8859-1 Hi there, As you may have seen in another thread this morning, someone's asked that I upgrade apacheds-maven-plugin to ApacheDS 1.5.7. This hasn't gone as smoothly as I had hoped. ApacheDS 1.5.7's mechanism for populating the schema directory involves trawling through every entry in the java.class.path system property looking for JARs that contain schema files. The relevant code is in org.apache.directory.shared:shared-ldap-schema:0.9.19 . Maven doesn't use -classpath (or set java.class.path) when running plugins, so this mechanism fails - the only JAR it finds is Maven's classworlds bootstrap JAR, which obviously has nothing interesting in it. In fact, this mechanism fails for any program that doesn't use the root classloader to load ApacheDS. I think the only universally workable solution is to change the packaging for the schema LDIF files so that instead of being scanned, each JAR that contains schema files also contains an index file at a known location (such as META-INF/apacheds/schema) listing all of the schema files in that JAR. Unfortunately, that's a pretty labour-intensive solution (it means anyone who adds a schema to shared-ldap-schema or related artifacts has to remember to update the index as well, or that someone has to tune the build to generate the index file. I'm happy to set this up, if it turns out to be the best solution. (As you can tell, I'm already fairly adept at extending Maven. :) I see in trunk that ResourceMap now accepts a system property that can be set to the locations of JARs to load to skip classpath scanning. This doesn't completely help, either, since I'm hesitant to do things with global side effects (like set System properties) in the middle of a Maven plugin. I can come up with a list of relevant JARs by trawling the artfact information in my plugin, so if there were a way to pass that list directly to ResourceMap I'd prefer to use that. I can write that up as a patch, if you're interested. I don't think there's a good solution for supporting ApacheDS 1.5.7 in apacheds-maven-plugin as it stands, unfortunately. If anyone has any thoughts that don't involve temporarily faking the java.class.path system property, I'm all ears. -o