You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Laurie Harper <la...@holoweb.net> on 2006/03/10 20:07:55 UTC

ant/maven integration and optional tasks

I'm trying to integrate an Ant build which uses optional tasks 
(specifically, the <script> task) into a Maven2 build. The trouble is, I 
can't find a way to get the necessary dependencies onto the classpath.

I'm using Maven's antrun plugin to call the Ant build using the <ant> 
task. But I don't see any mechanism in the <ant> task for specifying the 
classpath that should be used for the invoked build.

Since I also can't see a way with Maven's antrun plugin to specify a 
classpath to invoke Ant with, I'm at a dead end.

Is there a general mechanism in Ant for importing dependencies for 
optional tasks that might work in this scenario? Ideally I'd like the 
Ant build to work when invoked with Ant as well as when invoked through 
Mavent, but I'd settle for a solution that only worked with Maven if 
that's the best that can be achieved.

Thanks,

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant/maven integration and optional tasks

Posted by Laurie Harper <la...@holoweb.net>.
Hmm, I missed double-jar requirement for using non-JDK impls, so I can 
give that a try. But it does seem odd that Ant couldn't use the 
Jdk14RegexpRegexp impl.

L.

Antoine Levy-Lambert wrote:
> Hello Laurie,
> 
> please look at this manual page :
> http://ant.apache.org/manual/CoreTypes/regexp.html
> maybe this paragraph can help you :
> The property ant.regexp.regexpimpl governs which regular expression
> implementation will be chosen. Possible values for this property are :
> 
>   a.. org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
>   b.. org.apache.tools.ant.util.regexp.JakartaOroRegexp
>   c.. org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
> Also, if you want to use the Oro implementation of regexp, you then need
> ant-apache-oro.jar and jakarta-oro.jar in the classpath.
> Similarily, you will need jakarta-regexp.jar and ant-apache-regexp.jar in
> the last case.
> 
> Most optional tasks in ant require at least 2 jars, one containing the
> bridge code between ant and the external dependency, the other one being the
> external dependency itself.
> 
> I am surprised that the org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
> does not work.
> 
> Regards,
> 
> Antoine
> 
> ----- Original Message ----- 
> From: "Laurie Harper" <la...@holoweb.net>
> To: <us...@ant.apache.org>
> Sent: Saturday, March 11, 2006 3:32 AM
> Subject: Re: ant/maven integration and optional tasks
> 
> 
>> Laurie Harper wrote:
>>> I'm trying to integrate an Ant build which uses optional tasks
>>> (specifically, the <script> task) into a Maven2 build. The trouble is, I
>>> can't find a way to get the necessary dependencies onto the classpath.
>>>
>>> I'm using Maven's antrun plugin to call the Ant build using the <ant>
>>> task. But I don't see any mechanism in the <ant> task for specifying the
>>> classpath that should be used for the invoked build.
>>>
>>> Since I also can't see a way with Maven's antrun plugin to specify a
>>> classpath to invoke Ant with, I'm at a dead end.
>>>
>>> Is there a general mechanism in Ant for importing dependencies for
>>> optional tasks that might work in this scenario? Ideally I'd like the
>>> Ant build to work when invoked with Ant as well as when invoked through
>>> Mavent, but I'd settle for a solution that only worked with Maven if
>>> that's the best that can be achieved.
>> OK, thanks to a response on the Maven list I figured out how to
>> configure the plugin with the necessary dependencies. However, now I
>> have a different problem.
>>
>> Ant is now complaining about the <replaceregex> optional task. According
>> to the manual, it should be able to use the JDK's regex APIs (I'm using
>> JDK 1.5). I tried supplying ORO or Jakarta Regex but got the missing
>> dependencies error with all tree configurations.
>>
>> What am I missing? Does this task have additional, undocumented
>> dependencies?
>>
>> L.
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to access a SQL database through ANT

Posted by Greg Akins <ga...@insomnia-consulting.org>.
ant sql just uses jdbc.

You'll need the jdbc drivers for your database.

If you dont have access to a database already, then yes, you'll have
to install the database.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: how to access a SQL database through ANT

Posted by Shailesh Sharma <sh...@yahoo.com>.
Honestly, i googled on the ant SQL task and found out some examples. But if you can let me know what is needed before these tasks can be used , that will save lot of my time (ofcourse if you want).
   
  do i need to install SQL Server on my box ?
  what drivers ?
  any specific ant package ?
   
  thanks, shailesh
  
Antoine Levy-Lambert <an...@gmx.de> wrote:
  Hello,

please simply read the ant manual. There is a SQL task with which you can
execute SQL statements.

Regards,

Antoine
----- Original Message ----- 
From: "Shailesh Sharma" 
To: "Ant Users List" 
Sent: Monday, March 13, 2006 10:46 PM
Subject: how to access a SQL database through ANT


> Hi,
>
> I have a small ANT script that iam using to remote deploy my weblogic
applications. It uses weblogic.Deployer internally and after deployment, it
backs up my EAR/WAR files in a separate folder.
>
> Now, I wanted to make an entry in the SQL database after iam done
deploying > backing up files.
>
> Does somebody know what ant package do i need and if somebody can share
some ant build snippets, that be great.
>
> thanks, shailesh
>
>
> 
> 
> failonerror="true">
> 
> 

> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> ---------------------------------
> Brings words and photos together (easily) with
> PhotoMail - it's free and works with Yahoo! Mail.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org



		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 

Re: how to access a SQL database through ANT

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello,

please simply read the ant manual. There is a SQL task with which you can
execute SQL statements.

Regards,

Antoine
----- Original Message ----- 
From: "Shailesh Sharma" <sh...@yahoo.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Monday, March 13, 2006 10:46 PM
Subject: how to access a SQL database through ANT


> Hi,
>
>   I have a small ANT script that iam using to remote deploy my weblogic
applications.  It uses weblogic.Deployer internally and after deployment, it
backs up my EAR/WAR files in a separate folder.
>
>   Now, I wanted to make an entry in the SQL database after iam done
deploying > backing up files.
>
>   Does somebody know what ant package do i need and if somebody can share
some ant build snippets, that be great.
>
>   thanks, shailesh
>
>
>   </target>
>   <target name="deploy-now-on-testnet">
>       <java classname="weblogic.Deployer" fork="true" maxmemory="256m"
failonerror="true">
>             <classpath>
>                     <pathelement path="${CLASSPATH}"/>
>             </classpath>
>               <arg line="-username system"/>
>             <arg line="-password ${pass.testnet}"/>
>             <arg line="-adminurl ${testnet.admin.url}"/>
>             <arg value="-upload"/>
>             <arg value="-stage"/>
>             <arg value="-${deploy.utility}"/>
>             <arg line="-source ${APP_PATH_TEST}/${source}"/>
>             <arg line="-targets ${sipApplication.target}"/>
>             <sysproperty key="weblogic.home" path="${WL_HOME}"/>
>     </java>
>       <tstamp/>
>       <copy todir="../last-deployed-testnet">
>            <fileset dir="../current-testnet"/>
>            <mapper type="glob" from="*" to="*.${DSTAMP}.${TSTAMP}"/>
>     </copy>
>   </target>
>
>
> ---------------------------------
> Brings words and photos together (easily) with
>  PhotoMail  - it's free and works with Yahoo! Mail.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


how to access a SQL database through ANT

Posted by Shailesh Sharma <sh...@yahoo.com>.
Hi,
   
  I have a small ANT script that iam using to remote deploy my weblogic applications.  It uses weblogic.Deployer internally and after deployment, it backs up my EAR/WAR files in a separate folder.
   
  Now, I wanted to make an entry in the SQL database after iam done deploying > backing up files.
   
  Does somebody know what ant package do i need and if somebody can share some ant build snippets, that be great.
   
  thanks, shailesh
   
   
  </target>
  <target name="deploy-now-on-testnet">
      <java classname="weblogic.Deployer" fork="true" maxmemory="256m" failonerror="true">
            <classpath>
                    <pathelement path="${CLASSPATH}"/>
            </classpath>
              <arg line="-username system"/>
            <arg line="-password ${pass.testnet}"/>
            <arg line="-adminurl ${testnet.admin.url}"/>
            <arg value="-upload"/>
            <arg value="-stage"/>
            <arg value="-${deploy.utility}"/>
            <arg line="-source ${APP_PATH_TEST}/${source}"/>
            <arg line="-targets ${sipApplication.target}"/>
            <sysproperty key="weblogic.home" path="${WL_HOME}"/>
    </java>
      <tstamp/>
      <copy todir="../last-deployed-testnet">
           <fileset dir="../current-testnet"/>
           <mapper type="glob" from="*" to="*.${DSTAMP}.${TSTAMP}"/>
    </copy>
  </target>

		
---------------------------------
Brings words and photos together (easily) with
 PhotoMail  - it's free and works with Yahoo! Mail.

Re: ant/maven integration and optional tasks

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Laurie,

please look at this manual page :
http://ant.apache.org/manual/CoreTypes/regexp.html
maybe this paragraph can help you :
The property ant.regexp.regexpimpl governs which regular expression
implementation will be chosen. Possible values for this property are :

  a.. org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
  b.. org.apache.tools.ant.util.regexp.JakartaOroRegexp
  c.. org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
Also, if you want to use the Oro implementation of regexp, you then need
ant-apache-oro.jar and jakarta-oro.jar in the classpath.
Similarily, you will need jakarta-regexp.jar and ant-apache-regexp.jar in
the last case.

Most optional tasks in ant require at least 2 jars, one containing the
bridge code between ant and the external dependency, the other one being the
external dependency itself.

I am surprised that the org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
does not work.

Regards,

Antoine

----- Original Message ----- 
From: "Laurie Harper" <la...@holoweb.net>
To: <us...@ant.apache.org>
Sent: Saturday, March 11, 2006 3:32 AM
Subject: Re: ant/maven integration and optional tasks


> Laurie Harper wrote:
> > I'm trying to integrate an Ant build which uses optional tasks
> > (specifically, the <script> task) into a Maven2 build. The trouble is, I
> > can't find a way to get the necessary dependencies onto the classpath.
> >
> > I'm using Maven's antrun plugin to call the Ant build using the <ant>
> > task. But I don't see any mechanism in the <ant> task for specifying the
> > classpath that should be used for the invoked build.
> >
> > Since I also can't see a way with Maven's antrun plugin to specify a
> > classpath to invoke Ant with, I'm at a dead end.
> >
> > Is there a general mechanism in Ant for importing dependencies for
> > optional tasks that might work in this scenario? Ideally I'd like the
> > Ant build to work when invoked with Ant as well as when invoked through
> > Mavent, but I'd settle for a solution that only worked with Maven if
> > that's the best that can be achieved.
>
> OK, thanks to a response on the Maven list I figured out how to
> configure the plugin with the necessary dependencies. However, now I
> have a different problem.
>
> Ant is now complaining about the <replaceregex> optional task. According
> to the manual, it should be able to use the JDK's regex APIs (I'm using
> JDK 1.5). I tried supplying ORO or Jakarta Regex but got the missing
> dependencies error with all tree configurations.
>
> What am I missing? Does this task have additional, undocumented
> dependencies?
>
> L.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ant/maven integration and optional tasks

Posted by Laurie Harper <la...@holoweb.net>.
Laurie Harper wrote:
> I'm trying to integrate an Ant build which uses optional tasks 
> (specifically, the <script> task) into a Maven2 build. The trouble is, I 
> can't find a way to get the necessary dependencies onto the classpath.
> 
> I'm using Maven's antrun plugin to call the Ant build using the <ant> 
> task. But I don't see any mechanism in the <ant> task for specifying the 
> classpath that should be used for the invoked build.
> 
> Since I also can't see a way with Maven's antrun plugin to specify a 
> classpath to invoke Ant with, I'm at a dead end.
> 
> Is there a general mechanism in Ant for importing dependencies for 
> optional tasks that might work in this scenario? Ideally I'd like the 
> Ant build to work when invoked with Ant as well as when invoked through 
> Mavent, but I'd settle for a solution that only worked with Maven if 
> that's the best that can be achieved.

OK, thanks to a response on the Maven list I figured out how to 
configure the plugin with the necessary dependencies. However, now I 
have a different problem.

Ant is now complaining about the <replaceregex> optional task. According 
to the manual, it should be able to use the JDK's regex APIs (I'm using 
JDK 1.5). I tried supplying ORO or Jakarta Regex but got the missing 
dependencies error with all tree configurations.

What am I missing? Does this task have additional, undocumented 
dependencies?

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org