hmmm,

in the partial listing below, for namespaces I have;

xmlns:j="jelly:core"  xmlns:define="jelly:define"

declared, is that all I need? I've moved this to <project> with the same
results. It seems to run ok (no problems with namespaces I mean), as I say,
the error is a classpath one when running it (see below).

BUILD FAILED
File...... C:\workspaces\spikes\...\maven.xml
Element... define:jellybean
Line...... 23
Column.... 27
Could not find class: com.foo.util.MyTask using ClassLoader: null

and above that I get a Java stack track with
java.lang.ClassNotFoundException...

The class is indeed in my project and I built the project (java:compile)
before running my goal below (I thought I'd run it interactively first to
get it working before attached to a preGoal or whatever).

Have you got any examples or people doing a similar thing?

Cheers,


Arnaud HERITIER wrote:
> 
> Your jelly code seems wrong.
> You have to declare your namespace in the tag project :
> 
> <project xmlns:j="jelly:core" xmlns:u="jelly:util" xmlns:x="jelly:xml"
> xmlns:ant="jelly:ant" xmlns:maven="jelly:maven"...>
>  
> </project>
> 
> Your class is in your project ? Thus you have to build it before to call
> your goal (with the jar goal for example).
>  
> I think that your classes are defined in the default classloader.
> 
> Arnaud
> 
> 
> diyfiesta wrote:
>> 
>> Hey Folks,
>> 
>> Any tips / pointers for calling Java code from Jelly / Maven's maven.xml?
>> I'm having classpath issues and don't want to expose it as a plugin,
>> rather just call it from maven.xml...
>> 
>> ta
>> 
>> 
>> diyfiesta wrote:
>>> 
>>> Hi Folks,
>>> 
>>> I've writen a POJO to do something useful and wanted to use it as part
>>> of my
>>> build. So I thought I'd try and kick it off form the maven.xml.
>>> 
>>> So, I did something similar to this;
>>> 
>>>     <goal name="myGoal">
>>>         <j:jelly xmlns:j="jelly:core" xmlns:define="jelly:define"
>>> xmlns:my="myTag">
>>>             <define:taglib uri="myTag">
>>>                 <define:jellybean name="foo" className="com.foo.MyTask"
>>>                     method="execute"/>
>>>               </define:taglib>
>>>             <my:foo x="x" outputDir="docs" />
>>>         </j:jelly>
>>>     </goal>
>>> 
>>> But I get ClassNotFoundException for com.foo.MyTask, which I guess is
>>> reasonable as I havn't set the classpath. I spotted you can add a
>>> Classloader attribute to the jellybean element, but I wouldn't know what
>>> to
>>> set this to...
>>> 
>>> So, can I call Java from maven.xml or do I have to create a new plugin?
>>> 
>>> I don't want to create a new maven plugin if I can help it (I want this
>>> utility class as part of my application rather than a seperate source
>>> tree).
>>> 
>>> Thanks in advance,
>>> -- 
>>> Toby
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/%7Bm1%7D-running-java-from-maven.xml-tf3022149s177.html#a8446907
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to