You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "M. Sean Gilligan" <se...@msgilligan.com> on 2005/04/25 21:11:07 UTC

RE: tag and ANY SCRIPTING LANGUAGE

> If it's ant 1.6 or higher only,

Ant 1.6.1 added built-in support for Groovy, but the script tag exists in Ant 1.5.3 and should work with JavaScript and/or BeanShell directly.

>you'd have to either use maven 1.1

I'd like  to wait for a (beta) release before attempting Maven 1.1.  Any hints as to when there might be a release?

>or replace all ant-jar's in mavens lib/ directory with the 1.6 versions..

I don't think you can just replace the ant jars in Maven's lib with 1.6 versions -- have you done it?

I'm definitely willing to "settle"  for BeanShell (or JavaScript if someone can tell me how to make it work.

-- Sean

>
>> I have 5 scripting languages working in ANT, but cut-and-paste to maven doesn't work.  I can't get the <ant:script> tag to work in Maven 1.0.2 with any language.
>>
>> >If you can get one script language to work, it shouldn't be a big leap
>> >to get other ones working too. Especially since maven will do anything
>> >ant can do. If it's not working in maven, try writing it in ant first.
>> >Once you've worked out the problem in ant, it's usually little more than
>> >a cut-and-paste job to get it into maven.
>> >
>> >Adam
>> >
>> >-----Original Message-----
>> >From: M. Sean Gilligan [mailto:seanlist@msgilligan.com]
>> >Sent: 24 April 2005 23:03
>> >To: users@maven.apache.org
>> >Subject: <ant:script> tag and Groovy
>> >
>> >
>> >Hello Maven Mavens:
>> >
>> >Using ant 1.6.1, I can use the ant <script> tag to run short scripts in
>> >JavaScript, Groovy, Jython, and Beanshell.  (as long as the right jars
>> >are in my ant/lib directory...)
>> >
>> >I'd like to be able to do this in a maven.xml file under Maven 1.0.2.
>> >Is this possible?
>> >
>> >My first choice would be Groovy (or perhaps Beanshell) as I don't want
>> >to learn Python, and am not sure JavaScript gives me the file access
>> >that I need.  (I know Groovy has its warts, but it works fairly well for
>> >me in short scripts.)
>> >
>> >I've thrashed around a bit and can't seem to get any language to work in
>> >the <ant:script> tag.  I did manage to get the following to work:
>> >
>> >   <jython:script>
>> >print "This is a jython script"
>> >print "My Maven POM's name is", pom.getName()
>> >print "If the POM has a name, then the context passing is working"
>> >    </jython:script>
>> >
>> >After putting xmlns:jython="jelly:jython" in the root <project> tag and
>> >the (correct?) jar files in Maven's path.
>> >
>> >I've looked in the maven site, the mailing lists, and done Google
>> >searches, and can't find any documentation or examples of how to do
>> >this.  I thrashed around for far too long with the only progress being
>> >the jython:script test code above.
>> >
>> >I there a way to do this in Maven 1.0.2?  Is it documented?  If not,
>> >will Maven 1.1 (with ant 1.6.x) make it easier?
>> >
>> >Thanks,
>> >
>> >Sean
>> >
>> >--
>> >------------------------------------------------------------------------
>> >---
>> >M. Sean Gilligan                    : 831-466-9788 x11
>> >vBlog Central			    : http://www.vblogcentral.com
>> >------------------------------------------------------------------------
>> >---
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>> >http://www.bbc.co.uk/
>> >
>> >This e-mail (and any attachments) is confidential and may contain
>> >personal views which are not the views of the BBC unless specifically
>> >stated.
>> >If you have received it in error, please delete it from your system.
>> >Do not use, copy or disclose the information in any way nor act in
>> >reliance on it and notify the sender immediately. Please note that the
>> >BBC monitors e-mails sent or received.
>> >Further communication will signify your consent to this.
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>> --
>> ---------------------------------------------------------------------------
>> M. Sean Gilligan                    : 831-466-9788 x11
>> vBlog Central			    : http://www.vblogcentral.com
>> ---------------------------------------------------------------------------
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
>--
>Kenney Westerhof
>http://www.neonics.com
>GPG public key: http://www.gods.nl/~forge/kenneyw.key
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org


-- 
---------------------------------------------------------------------------
M. Sean Gilligan                    : 831-466-9788 x11
vBlog Central			    : http://www.vblogcentral.com
---------------------------------------------------------------------------

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


RE: Scripting Maven 1.0 with BeanShell and Jython

Posted by Mattias Olofsson <ma...@xdin.com>.
Hi, 
I'm using BeanShell in my plugin, perhaps you can find something usefull
if you look at the plugin.jelly

http://olofsson.homeip.net/maven-ui-plugin-site/index.html


Mvh 

Mattias Olofsson

Software Developer, M. Sc. Physics 

 

XDIN AB
Gustaf Werners gata 12
SE-421 32 Västra Frölunda
Office: +46 (0)31 725 10 92
mail: mattias.olofsson@xdin.com   
 
This e-mail is confidential and may also be legally privileged.
If you are not the intended recipient, please notify us
immediately; you should not copy it or use it for any purpose,
nor disclose its contents to any other person.         

-----Original Message-----
From: M. Sean Gilligan [mailto:seanlist@msgilligan.com] 
Sent: den 26 april 2005 02:47
To: Maven Users List
Subject: Scripting Maven 1.0 with BeanShell and Jython

I've been able to get BeanShell and Jython to work and documented what I did
on this page:
http://www.msgilligan.com/maven-scripting.html

I'd still like to be able to do the following:
1) Use the <ant:script> tag rather than Jelly tags (for consistency)
2) Be able to read and write properties from the scripts
3) Be able to use Groovy

I'll probably use BeanShell until Groovy is supported, but would if anyone
knows how to read or write maven properties from the script that would be
great.

-- Sean


--
---------------------------------------------------------------------------
M. Sean Gilligan                    : 831-466-9788 x11
vBlog Central			    : http://www.vblogcentral.com
---------------------------------------------------------------------------

---------------------------------------------------------------------
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


Scripting Maven 1.0 with BeanShell and Jython

Posted by "M. Sean Gilligan" <se...@msgilligan.com>.
I've been able to get BeanShell and Jython to work and documented what I did on this page:
http://www.msgilligan.com/maven-scripting.html

I'd still like to be able to do the following:
1) Use the <ant:script> tag rather than Jelly tags (for consistency)
2) Be able to read and write properties from the scripts
3) Be able to use Groovy

I'll probably use BeanShell until Groovy is supported, but would if anyone knows how to read or write maven properties from the script that would be great.

-- Sean


-- 
---------------------------------------------------------------------------
M. Sean Gilligan                    : 831-466-9788 x11
vBlog Central			    : http://www.vblogcentral.com
---------------------------------------------------------------------------

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


RE: tag and ANY SCRIPTING LANGUAGE

Posted by Kenney Westerhof <fo...@neonics.com>.
On Mon, 25 Apr 2005, M. Sean Gilligan wrote:

> > If it's ant 1.6 or higher only,
>
> Ant 1.6.1 added built-in support for Groovy, but the script tag exists
> in Ant 1.5.3 and should work with JavaScript and/or BeanShell directly.

Well, if it exists it should work. Try a basic build.xml using ant 1.5.3
and if that works those tags should work in maven.xml too..

>
> >you'd have to either use maven 1.1
>
> I'd like to wait for a (beta) release before attempting Maven 1.1.  Any
> hints as to when there might be a release?

A developer will have to answer this.. I've used it and found the
stability depending on the day you do a checkout.. So I understand you
wanting to wait ;)

> >or replace all ant-jar's in mavens lib/ directory with the 1.6 versions..
>
> I don't think you can just replace the ant jars in Maven's lib with 1.6
> versions -- have you done it?

I've done it, works perfectly. :)
I think this way you can get maven.xml to be run using ant 1.6.
However, when a plugin explicitly refers to ant 1.5.3, that plugin gets
run using that ant version, so you might also want to overwrite
the jars in the local repository with the 1.6 versions (renaming them
to 1.5). I know it's not the preferred way to go, but if you don't
want to wait for maven 1.1 and you HAVE to use ant 1.6 features in
maven.xml, this certainly works (at least for me - could be you
get a NoClassDefFoundError or NoSuchMethodException or something
when you use an obscure tag, but it's easy to revert..)

>
> I'm definitely willing to "settle"  for BeanShell (or JavaScript if
> someone can tell me how to make it work.

You might want to check out scripting support for Jelly. The scripting
language is pluggable (defaults to Jexl), so you might be able to find
a JavaScript language plugin for Jelly.

-- Kenney

>
> -- Sean
>
> >
> >> I have 5 scripting languages working in ANT, but cut-and-paste to maven doesn't work.  I can't get the <ant:script> tag to work in Maven 1.0.2 with any language.
> >>
> >> >If you can get one script language to work, it shouldn't be a big leap
> >> >to get other ones working too. Especially since maven will do anything
> >> >ant can do. If it's not working in maven, try writing it in ant first.
> >> >Once you've worked out the problem in ant, it's usually little more than
> >> >a cut-and-paste job to get it into maven.
> >> >
> >> >Adam
> >> >
> >> >-----Original Message-----
> >> >From: M. Sean Gilligan [mailto:seanlist@msgilligan.com]
> >> >Sent: 24 April 2005 23:03
> >> >To: users@maven.apache.org
> >> >Subject: <ant:script> tag and Groovy
> >> >
> >> >
> >> >Hello Maven Mavens:
> >> >
> >> >Using ant 1.6.1, I can use the ant <script> tag to run short scripts in
> >> >JavaScript, Groovy, Jython, and Beanshell.  (as long as the right jars
> >> >are in my ant/lib directory...)
> >> >
> >> >I'd like to be able to do this in a maven.xml file under Maven 1.0.2.
> >> >Is this possible?
> >> >
> >> >My first choice would be Groovy (or perhaps Beanshell) as I don't want
> >> >to learn Python, and am not sure JavaScript gives me the file access
> >> >that I need.  (I know Groovy has its warts, but it works fairly well for
> >> >me in short scripts.)
> >> >
> >> >I've thrashed around a bit and can't seem to get any language to work in
> >> >the <ant:script> tag.  I did manage to get the following to work:
> >> >
> >> >   <jython:script>
> >> >print "This is a jython script"
> >> >print "My Maven POM's name is", pom.getName()
> >> >print "If the POM has a name, then the context passing is working"
> >> >    </jython:script>
> >> >
> >> >After putting xmlns:jython="jelly:jython" in the root <project> tag and
> >> >the (correct?) jar files in Maven's path.
> >> >
> >> >I've looked in the maven site, the mailing lists, and done Google
> >> >searches, and can't find any documentation or examples of how to do
> >> >this.  I thrashed around for far too long with the only progress being
> >> >the jython:script test code above.
> >> >
> >> >I there a way to do this in Maven 1.0.2?  Is it documented?  If not,
> >> >will Maven 1.1 (with ant 1.6.x) make it easier?
> >> >
> >> >Thanks,
> >> >
> >> >Sean
> >> >
> >> >--
> >> >------------------------------------------------------------------------
> >> >---
> >> >M. Sean Gilligan                    : 831-466-9788 x11
> >> >vBlog Central			    : http://www.vblogcentral.com
> >> >------------------------------------------------------------------------
> >> >---
> >> >
> >> >---------------------------------------------------------------------
> >> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >For additional commands, e-mail: users-help@maven.apache.org
> >> >
> >> >
> >> >http://www.bbc.co.uk/
> >> >
> >> >This e-mail (and any attachments) is confidential and may contain
> >> >personal views which are not the views of the BBC unless specifically
> >> >stated.
> >> >If you have received it in error, please delete it from your system.
> >> >Do not use, copy or disclose the information in any way nor act in
> >> >reliance on it and notify the sender immediately. Please note that the
> >> >BBC monitors e-mails sent or received.
> >> >Further communication will signify your consent to this.
> >> >
> >> >---------------------------------------------------------------------
> >> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > >For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >> --
> >> ---------------------------------------------------------------------------
> >> M. Sean Gilligan                    : 831-466-9788 x11
> >> vBlog Central			    : http://www.vblogcentral.com
> >> ---------------------------------------------------------------------------
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >
> >--
> >Kenney Westerhof
> >http://www.neonics.com
> >GPG public key: http://www.gods.nl/~forge/kenneyw.key
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
>
>
> --
> ---------------------------------------------------------------------------
> M. Sean Gilligan                    : 831-466-9788 x11
> vBlog Central			    : http://www.vblogcentral.com
> ---------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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