This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 672319

Summary: rhq-ant.cmd command script is not compatible with Windows
Product: [Other] RHQ Project Reporter: Larry O'Leary <loleary>
Component: Launch ScriptsAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: 3.0.0CC: skondkar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Windows 7 64-bit rhq-ant-bundle-common-3.0.0.GA
Last Closed: 2013-09-02 03:23:47 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
Patch diff to remove unneeded files and add missing file
none
Patch diff to remove unneeded files and add missing file with RHQ specific updates
none
rhq-ant-bat based on Ant 1.8.0 ant.bat none

Description Larry O'Leary 2011-01-24 15:07:27 EST
The rhq-ant.cmd command script is for OS/2 and not for Windows. It appears this file was copied from the Apache Ant bin directory (ant.cmd) instead of ant.bat which is the Windows version.

If executing the rhq-ant.cmd file the output is:

C:\Users\redhat\Desktop\rhq-bundle-deployer-3.0.0.GA\rhq-ant-bundle-common-3.0.0.GA\bin>rhq-ant.cmd -version

C:\Users\redhat\Desktop\rhq-bundle-deployer-3.0.0.GA\rhq-ant-bundle-common-3.0.0.GA\bin>/*
'/*' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\redhat\Desktop\rhq-bundle-deployer-3.0.0.GA\rhq-ant-bundle-common-3.0.0.GA\bin>Licensed to the Apache Software Foundation (ASF) under one or more
'Licensed' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\redhat\Desktop\rhq-bundle-deployer-3.0.0.GA\rhq-ant-bundle-common-3.0.0.GA\bin>contributor license agreements.  See the NOTICE file distributed with
'contributor' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\redhat\Desktop\rhq-bundle-deployer-3.0.0.GA\rhq-ant-bundle-common-3.0.0.GA\bin>this work for additional information regarding copyright ownership.
'this' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\redhat\Desktop\rhq-bundle-deployer-3.0.0.GA\rhq-ant-bundle-common-3.0.0.GA\bin>The ASF licenses this file to You under the Apache License, Version 2.0

'The' is not recognized as an internal or external command,
operable program or batch file.
you was unexpected at this time.

C:\Users\redhat\Desktop\rhq-bundle-deployer-3.0.0.GA\rhq-ant-bundle-common-3.0.0.GA\bin>   (the "License"); you may not use this file except in compliance with
Comment 1 Larry O'Leary 2011-01-24 15:15:11 EST
To resolve this issue:

cd modules/common/ant-bundle/src/main/assembly/bin

Download ant.bat: 
wget
https://svn.apache.org/repos/asf/gump/trunk/test/fixture/packages/ant-1.6.2/bin/ant.bat

Rename:
mv ant.bat rhq-ant.bat

Remove other OS/2 scripts:
rm antenv.cmd envset.cmd rhq-ant.cmd runrc.cmd
Comment 2 Larry O'Leary 2011-01-24 15:59:26 EST
Created attachment 475045 [details]
Patch diff to remove unneeded files and add missing file
Comment 3 Ian Springer 2011-01-24 17:22:53 EST
rhq-ant.bat also needs to be modified to call the RHQ Ant main class rather the standard Ant main class, and perhaps other changes (the equivalent of whatever changes were made to the rhq-ant shell script).
Comment 4 Larry O'Leary 2011-01-24 19:36:30 EST
Created attachment 475091 [details]
Patch diff to remove unneeded files and add missing file with RHQ specific updates

Based on comment 3, I have updated the patch to include the RHQ specific changes to ant.bat. The changes are noted in the attachment but essentially the only thing that seems to have been necessary from the ant -> rhq-ant version of the script in the Windows world is:

ANT_HOME environment variable changed to RHQ_ANT_HOME
User specific pre and post configuration scripts for ANT are pulled from .rhq/rhq-antrc-pre.bat and .rhq/rhq-antrc-post.bat instead of their default of antrc-pre.bat and antrc-post.bat located in the user's home directory.
The -main ANT argument is now referencing org.rhq.bundle.ant.AntMain

The only noticable difference between the rhq-ant and rhq-ant.bat scripts is the order of the JARs loaded from the lib directory. This can be seen by running rhq-ant -diagnostics.
Comment 5 John Mazzitelli 2011-02-11 11:08:50 EST
Created attachment 478269 [details]
rhq-ant-bat based on Ant 1.8.0 ant.bat

the bundle deployer tool utilizes Ant 1.8.0, not 1.6.2. Therefore the attached patch version of rhq-ant.bat is not fully correct. I will attach rhq-ant.bat that is based off of ant 1.8.0
Comment 6 John Mazzitelli 2011-02-11 14:55:32 EST
this is done. note that the attended rhq-ant.bat based on 1.8 was not fully correct - missed two additional places where the -main argument needed to be passed in. I checked in the fully corrected script and I tested on WinXP and and it worked fine.

commits:
d3799e2f59f40845bdf2da3898d347ae4e795cdd
5a7f6fb357fab1abfdfe1d40735596e1f7ad5baf
Comment 7 John Mazzitelli 2011-02-11 14:56:48 EST
last comment: "attended" should have been "attached"
Comment 8 Sunil Kondkar 2011-06-15 07:48:37 EDT
Verified on build 135 (Version: 4.1.0-SNAPSHOT Build Number: 925b384)

Downloaded and extracted the rhq-bundle-deployer-4.1.0-SNAPSHOT.zip to windows box.
Verified that the bin directory has file 'rhq-ant.bat'.
Copied deploy.xml and bundle files to the bin directory of the bundle deployer tool and deployed the bundle successfully.

Marking as verified.
Comment 9 Heiko W. Rupp 2013-09-02 03:23:47 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.