directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-Arnaud Marcelot ...@marcelot.net>
Subject Re: Schema Index and Maven plugin was: Re: svn commit: r1038592 - in /directory/shared/trunk/ldap-schema/src/main: java/org/apache/directory/shared/ldap/schema/ldif/extractor/impl/ResourceMap.java resources/META-INF/ resources/META-INF/apacheds-schema.in
Date Wed, 24 Nov 2010 16:09:16 GMT
Yes, it is... :)

For the record, here's how:
>       <plugin>
>         <artifactId>maven-antrun-plugin</artifactId>
>         <version>1.6</version>
>         <executions>
>           <execution>
>             <phase>generate-resources</phase>
>             <configuration>
>               <target>
>                 <!-- Various properties -->
>                 <property name="schema.index" value="target/classes/META-INF/apacheds-schema.index"/>
>                 <property name="schema.location" value="src/main/resources/"/>
>               
>                 <!-- Listing all LDIF files under schema location -->
>                 <path id="schema.files.path">
>                   <fileset dir="${schema.location}">
>                     <include name="**/*.ldif" />
>                     <exclude name="schema-all.ldif" />
>                   </fileset>
>                 </path>
>                 <property name="schema.files" refid="schema.files.path"/>
>                 
>                 <!-- Creating the schema index file -->
>                 <echo message="${schema.files}" file="${schema.index}"/>
>                 <replace file="${schema.index}">
>                   <replacefilter token=":" value="${line.separator}"/>
>                   <replacefilter token="${basedir}/${schema.location}" value=""/>
>                 </replace>
>               </target>
>             </configuration>
>             <goals>
>               <goal>run</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>

It has been committed at revision: 1038659.
http://svn.apache.org/viewvc?rev=1038659&view=rev

Regards,
Pierre-Arnaud

On 24 nov. 2010, at 16:21, Emmanuel Lecharny wrote:

> On 11/24/10 4:10 PM, Stefan Seelmann wrote:
>> Hi guys,
>> 
>> I committed the change below. It allows to use the schema loaders in
>> embedded environments (especially in Apache Directory Studio, but
>> should also work for web applications).
>> 
>> The idea is to have a fixed-named schema index file
>> "META-INF/apacheds-schema.index" that contains all resource paths to
>> the schema LDIF files. The ResourceMap class then can read that file
>> form its class loader to get all resources. Thanks to Owen Jacobson
>> for the idea.
>> 
>> Currently the index file is in the repository. I'm going to write a
>> Maven plugin to create that file automatically during the build. The
>> Maven plugin should bind to the generate-resource phase. The
>> alternative would be to use the exec plugin that executes something
>> like
>>   find src/main/resources/schema -name "*.ldif" | sed
>> 's:src/main/resources/::'>
>> target/classes/META-INF/apacheds-schema.index
>> but that wouldn't work on Windows.
>> 
>> If anyone has a better idea how to avoid a new Maven plugin, please tell.
> 
> Isn't it possible to do that using a ant task in maven ?
> 
> 
> -- 
> Regards,
> Cordialement,
> Emmanuel L├ęcharny
> www.iktek.com
> 


Mime
View raw message