You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Arnaud HERITIER <ah...@apache.org> on 2004/06/13 11:33:55 UTC

How to add a resource in a plugin classloader

Hello,

 

I have a little problem.

I want to use the ant style task to transform some xml files.

My xslt file uses a resource bundle to create some labels.

 

My resource bundle is stored in a properties file.

 

I tried to add this file in plugin's root directory but the bundle isn't
found.

 

How can I add something in the classloader used by ant tasks ???

 

<maven:addPath id="something" ./> ????

 

 

Arnaud

 


RE: How to add a resource in a plugin classloader

Posted by Arnaud Heritier <ah...@apache.org>.
> Is the resource in / of the plugin or /plugin-resources? The latter is
> where you
> pointed.

	Yes sorry,

	I tried both of them.
	I began to test in the / of the plugin because I thought that this
directory was available in the classloader.

	After that I tested with /plugin-resources.

> 
> I would simplify this to:
> <ant:taskdef name="mystyle"
> classname="org.apache.tools.ant.taskdefs.XSLTProcess">
>   <ant:classpath>
>     <ant:pathelement path="${plugin.resources}"/>
>     <ant:path refid="maven.dependency.classpath"/>
>   </ant:classpath>
> </ant:taskdef>

	I tried ...

> 
> Is everything working except the picking up of the resource from this
> point?

	.. and it works except the resource. I created an xslt file that
doesn't use a resource bundle and it's good :-(

> I've had style be stubborn before regardless of this.

	;-) Thanks

	Arnaud

> 
> - Brett
> 
> Quoting Arnaud Heritier <ah...@apache.org>:
> 
> > I tried to do it but without success.
> >
> > I created a path where I added the ${plugin.resources} and I used it in
> the
> > style task as a reference but it doesn't work.
> >
> > I also tried to create a new task with the customized path:
> >
> > <ant:path id="plugin">
> >   <ant:pathelement location="${plugin.resources}"/>
> > </ant:path>
> > <maven:addPath id="maven.dependency.classpath" refid="plugin"/>
> > <ant:taskdef name="mystyle"
> > classname="org.apache.tools.ant.taskdefs.XSLTProcess">
> >       <ant:classpath>
> >         <ant:path refid="maven.dependency.classpath"/>
> >       </ant:classpath>
> > </ant:taskdef>
> >
> > I don't know if it can be a problem with maven classloaders or there's a
> bug
> > in the ant style task or in xalan.
> >
> > For the moment I abandon.
> >
> > Thanks for your idea Brett.
> >
> > Cheers,
> >
> > Arnaud.
> >
> >
> > > -----Message d'origine-----
> > > De : Brett Porter [mailto:brett@apache.org]
> > > Envoyé : lundi 14 juin 2004 14:17
> > > À : Maven Users List
> > > Objet : Re: How to add a resource in a plugin classloader
> > >
> > > I think you need to pass the classpath/classpathref element to the
> style
> > > task. Build the classpath using standard <ant:path /> tags.
> > >
> > > - Brett
> > >
> > > Arnaud HERITIER wrote:
> > >
> > > >Hello,
> > > >
> > > >
> > > >
> > > >I have a little problem.
> > > >
> > > >I want to use the ant style task to transform some xml files.
> > > >
> > > >My xslt file uses a resource bundle to create some labels.
> > > >
> > > >
> > > >
> > > >My resource bundle is stored in a properties file.
> > > >
> > > >
> > > >
> > > >I tried to add this file in plugin's root directory but the bundle
> isn't
> > > >found.
> > > >
> > > >
> > > >
> > > >How can I add something in the classloader used by ant tasks ???
> > > >
> > > >
> > > >
> > > ><maven:addPath id="something" ./> ????
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >Arnaud
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: How to add a resource in a plugin classloader

Posted by Brett Porter <br...@apache.org>.
Is the resource in / of the plugin or /plugin-resources? The latter is where you
pointed.

I would simplify this to:
<ant:taskdef name="mystyle" classname="org.apache.tools.ant.taskdefs.XSLTProcess">
  <ant:classpath>
    <ant:pathelement path="${plugin.resources}"/>
    <ant:path refid="maven.dependency.classpath"/>
  </ant:classpath>
</ant:taskdef>

Is everything working except the picking up of the resource from this point?
I've had style be stubborn before regardless of this.

- Brett

Quoting Arnaud Heritier <ah...@apache.org>:

> I tried to do it but without success.
> 
> I created a path where I added the ${plugin.resources} and I used it in the
> style task as a reference but it doesn't work.
> 
> I also tried to create a new task with the customized path:
> 
> <ant:path id="plugin">
>   <ant:pathelement location="${plugin.resources}"/>
> </ant:path>
> <maven:addPath id="maven.dependency.classpath" refid="plugin"/>
> <ant:taskdef name="mystyle"
> classname="org.apache.tools.ant.taskdefs.XSLTProcess">
>       <ant:classpath>
>         <ant:path refid="maven.dependency.classpath"/>
>       </ant:classpath>
> </ant:taskdef>
> 
> I don't know if it can be a problem with maven classloaders or there's a bug
> in the ant style task or in xalan.
> 
> For the moment I abandon.
> 
> Thanks for your idea Brett.
> 
> Cheers,
> 
> Arnaud.
> 
> 
> > -----Message d'origine-----
> > De : Brett Porter [mailto:brett@apache.org]
> > Envoyé : lundi 14 juin 2004 14:17
> > À : Maven Users List
> > Objet : Re: How to add a resource in a plugin classloader
> > 
> > I think you need to pass the classpath/classpathref element to the style
> > task. Build the classpath using standard <ant:path /> tags.
> > 
> > - Brett
> > 
> > Arnaud HERITIER wrote:
> > 
> > >Hello,
> > >
> > >
> > >
> > >I have a little problem.
> > >
> > >I want to use the ant style task to transform some xml files.
> > >
> > >My xslt file uses a resource bundle to create some labels.
> > >
> > >
> > >
> > >My resource bundle is stored in a properties file.
> > >
> > >
> > >
> > >I tried to add this file in plugin's root directory but the bundle isn't
> > >found.
> > >
> > >
> > >
> > >How can I add something in the classloader used by ant tasks ???
> > >
> > >
> > >
> > ><maven:addPath id="something" ./> ????
> > >
> > >
> > >
> > >
> > >
> > >Arnaud
> > >
> > >
> > >
> > >
> > >
> > >
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: How to add a resource in a plugin classloader

Posted by Arnaud Heritier <ah...@apache.org>.
I tried to do it but without success.

I created a path where I added the ${plugin.resources} and I used it in the
style task as a reference but it doesn't work.

I also tried to create a new task with the customized path:

<ant:path id="plugin">
  <ant:pathelement location="${plugin.resources}"/>
</ant:path>
<maven:addPath id="maven.dependency.classpath" refid="plugin"/>
<ant:taskdef name="mystyle"
classname="org.apache.tools.ant.taskdefs.XSLTProcess">
      <ant:classpath>
        <ant:path refid="maven.dependency.classpath"/>
      </ant:classpath>
</ant:taskdef>

I don't know if it can be a problem with maven classloaders or there's a bug
in the ant style task or in xalan.

For the moment I abandon.

Thanks for your idea Brett.

Cheers,

Arnaud.


> -----Message d'origine-----
> De : Brett Porter [mailto:brett@apache.org]
> Envoyé : lundi 14 juin 2004 14:17
> À : Maven Users List
> Objet : Re: How to add a resource in a plugin classloader
> 
> I think you need to pass the classpath/classpathref element to the style
> task. Build the classpath using standard <ant:path /> tags.
> 
> - Brett
> 
> Arnaud HERITIER wrote:
> 
> >Hello,
> >
> >
> >
> >I have a little problem.
> >
> >I want to use the ant style task to transform some xml files.
> >
> >My xslt file uses a resource bundle to create some labels.
> >
> >
> >
> >My resource bundle is stored in a properties file.
> >
> >
> >
> >I tried to add this file in plugin's root directory but the bundle isn't
> >found.
> >
> >
> >
> >How can I add something in the classloader used by ant tasks ???
> >
> >
> >
> ><maven:addPath id="something" ./> ????
> >
> >
> >
> >
> >
> >Arnaud
> >
> >
> >
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to add a resource in a plugin classloader

Posted by Brett Porter <br...@apache.org>.
I think you need to pass the classpath/classpathref element to the style 
task. Build the classpath using standard <ant:path /> tags.

- Brett

Arnaud HERITIER wrote:

>Hello,
>
> 
>
>I have a little problem.
>
>I want to use the ant style task to transform some xml files.
>
>My xslt file uses a resource bundle to create some labels.
>
> 
>
>My resource bundle is stored in a properties file.
>
> 
>
>I tried to add this file in plugin's root directory but the bundle isn't
>found.
>
> 
>
>How can I add something in the classloader used by ant tasks ???
>
> 
>
><maven:addPath id="something" ./> ????
>
> 
>
> 
>
>Arnaud
>
> 
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org