Topic
  • 62 replies
  • Latest Post - ‏2010-10-25T07:06:41Z by RobertMartin
SystemAdmin
SystemAdmin
6042 Posts

Pinned topic Anyone using Headless ANT

‏2004-03-15T17:13:03Z |
Just wondered if anyone has used the headless ANT feature and if so, where you found information on using it. I've been through the out-dated 3-part article that explains some of it, but the information therein is lacking and incorrect at times.
Thanks
Updated on 2010-10-25T07:06:41Z at 2010-10-25T07:06:41Z by RobertMartin
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-22T19:06:07Z  
    "Headless Ant" is described in this article:

    http://www-106.ibm.com/developerworks/websphere/library/techarticles/020
    3_searle/searle1.html

    Unfortunately, Barry Searle's article appears to be out of date.

    The Online Help in WSAD 5.1.1 describes these Ant tasks:

    projectBuild
    getJavacErrorCount
    getProjectData
    setDebugInfo
    AppClientExport
    EARExport
    UtilJar
    WARExport
    AccessBeanRegeneration
    EJBDeploy
    EJBExport

    I found the runAnt.bat file in this directory:

    C:\Program Files\IBM\WebSphere Studio\Application
    Developer\v5.1.1\wstools\eclipse\plugins\com.ibm.etools.j2ee.ant_5.1.1

    When I execute runAnt.bat from a command prompt, it reports this error:

    Unknown argument: -consolelog

    Is this a flaw in IBM's batch file?
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-22T19:38:30Z  
    "Headless Ant" is described in this article:

    http://www-106.ibm.com/developerworks/websphere/library/techarticles/020
    3_searle/searle1.html

    Unfortunately, Barry Searle's article appears to be out of date.

    The Online Help in WSAD 5.1.1 describes these Ant tasks:

    projectBuild
    getJavacErrorCount
    getProjectData
    setDebugInfo
    AppClientExport
    EARExport
    UtilJar
    WARExport
    AccessBeanRegeneration
    EJBDeploy
    EJBExport

    I found the runAnt.bat file in this directory:

    C:\Program Files\IBM\WebSphere Studio\Application
    Developer\v5.1.1\wstools\eclipse\plugins\com.ibm.etools.j2ee.ant_5.1.1

    When I execute runAnt.bat from a command prompt, it reports this error:

    Unknown argument: -consolelog

    Is this a flaw in IBM's batch file?
    To workaround this issue, I removed "-consolelog" from the runAnt.bat file

    I guess IBM did not test runAnt.bat when they shipped WSAD 5.1.1
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-22T20:09:15Z  
    To workaround this issue, I removed "-consolelog" from the runAnt.bat file

    I guess IBM did not test runAnt.bat when they shipped WSAD 5.1.1
    Yeah, they kind of did not mention that you have to tailor the runAnt.bat script, eh?

    Our problem (right now) is that it does not appear that the tasks will work properly if the source code is not directly beneath the workspace. So, while we can get the "echo" demo script to work, nothing else will.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-22T22:11:46Z  
    Yeah, they kind of did not mention that you have to tailor the runAnt.bat script, eh?

    Our problem (right now) is that it does not appear that the tasks will work properly if the source code is not directly beneath the workspace. So, while we can get the "echo" demo script to work, nothing else will.
    > Yeah, they kind of did not mention that you have to
    > tailor the runAnt.bat script, eh?

    True. I had to tailor runAnt.bat for my local environment.

    > Our problem (right now) is that it does not appear
    > that the tasks will work properly if the source code
    > is not directly beneath the workspace. So, while we
    > can get the "echo" demo script to work, nothing else
    > will.

    Which type of project are you using?
    Java projects?
    Web application projects?
    EAR projects?

    I have a Java project called "Foo"

    Foo contains a source folder "src"

    My Java source files are in src.

    Will I be able to use headless ant to build this code?
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-22T22:20:30Z  
    > Yeah, they kind of did not mention that you have to
    > tailor the runAnt.bat script, eh?

    True. I had to tailor runAnt.bat for my local environment.

    > Our problem (right now) is that it does not appear
    > that the tasks will work properly if the source code
    > is not directly beneath the workspace. So, while we
    > can get the "echo" demo script to work, nothing else
    > will.

    Which type of project are you using?
    Java projects?
    Web application projects?
    EAR projects?

    I have a Java project called "Foo"

    Foo contains a source folder "src"

    My Java source files are in src.

    Will I be able to use headless ant to build this code?
    We are using EARs, EJBs, and Java projects.
    I'd assume that your Foo project would work fine with headless ant, but you might just want to use regular ant (I guess that would be ant WITH a head?).

    The reason I think that our headless ant is not working is that our source code is in a ClearCase VOB, and the VOB is not directly physically under a defined WorkSpace. Barry said that he was looking into whether or not headless ant has an issue with that type of set up, i.e. where the projects are in a different physical area from the workspace. No feedback as yet, though.

    There is also a product out there (name escapes me but you can find a link to it on the eclipse plug-ins page) that will build outside of websphere. I haven't had time to dink with it, though.
    > > Yeah, they kind of did not mention that you have
    > to
    > > tailor the runAnt.bat script, eh?
    >
    > True. I had to tailor runAnt.bat for my local
    > environment.
    >
    > > Our problem (right now) is that it does not appear
    > > that the tasks will work properly if the source
    > code
    > > is not directly beneath the workspace. So, while
    > we
    > > can get the "echo" demo script to work, nothing
    > else
    > > will.
    >
    > Which type of project are you using?
    > Java projects?
    > Web application projects?
    > EAR projects?
    >
    > I have a Java project called "Foo"
    >
    > Foo contains a source folder "src"
    >
    > My Java source files are in src.
    >
    > Will I be able to use headless ant to build this
    > code?
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-22T22:55:12Z  
    We are using EARs, EJBs, and Java projects.
    I'd assume that your Foo project would work fine with headless ant, but you might just want to use regular ant (I guess that would be ant WITH a head?).

    The reason I think that our headless ant is not working is that our source code is in a ClearCase VOB, and the VOB is not directly physically under a defined WorkSpace. Barry said that he was looking into whether or not headless ant has an issue with that type of set up, i.e. where the projects are in a different physical area from the workspace. No feedback as yet, though.

    There is also a product out there (name escapes me but you can find a link to it on the eclipse plug-ins page) that will build outside of websphere. I haven't had time to dink with it, though.
    > > Yeah, they kind of did not mention that you have
    > to
    > > tailor the runAnt.bat script, eh?
    >
    > True. I had to tailor runAnt.bat for my local
    > environment.
    >
    > > Our problem (right now) is that it does not appear
    > > that the tasks will work properly if the source
    > code
    > > is not directly beneath the workspace. So, while
    > we
    > > can get the "echo" demo script to work, nothing
    > else
    > > will.
    >
    > Which type of project are you using?
    > Java projects?
    > Web application projects?
    > EAR projects?
    >
    > I have a Java project called "Foo"
    >
    > Foo contains a source folder "src"
    >
    > My Java source files are in src.
    >
    > Will I be able to use headless ant to build this
    > code?
    > There is also a product out there (name escapes me
    > but you can find a link to it on the eclipse plug-ins
    > page) that will build outside of websphere. I
    > haven't had time to dink with it, though.
    >

    I found two tools:

    1) Instantiations CodePro Build

    http://www.instantiations.com

    2) OpenMake

    http://www.openmake.com/docs/openmake-eclipse.pdf
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-22T23:16:52Z  
    > There is also a product out there (name escapes me
    > but you can find a link to it on the eclipse plug-ins
    > page) that will build outside of websphere. I
    > haven't had time to dink with it, though.
    >

    I found two tools:

    1) Instantiations CodePro Build

    http://www.instantiations.com

    2) OpenMake

    http://www.openmake.com/docs/openmake-eclipse.pdf
    I am writing an Ant build script that will perform these
    tasks:

    1) checkout modules from CVS (using Ant's <cvs> task)
    2) tag the modules (using Ant's <cvs> task)
    3) build the WSAD projects using <projectBuild>
    4) export the projects to EAR files using <earExport>

    Is this possible?

  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-23T13:37:13Z  
    I am writing an Ant build script that will perform these
    tasks:

    1) checkout modules from CVS (using Ant's <cvs> task)
    2) tag the modules (using Ant's <cvs> task)
    3) build the WSAD projects using <projectBuild>
    4) export the projects to EAR files using <earExport>

    Is this possible?

    Yep, that's what they say. That is what we are looking at doing if we can get around the VOB problem, then throw it in a nightly cron job (and append a Junit auto tester). That's also why we were curious if anyone else out there has ever successfully used the headless ant capability.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-23T18:23:27Z  
    I am writing an Ant build script that will perform these
    tasks:

    1) checkout modules from CVS (using Ant's <cvs> task)
    2) tag the modules (using Ant's <cvs> task)
    3) build the WSAD projects using <projectBuild>
    4) export the projects to EAR files using <earExport>

    Is this possible?

    I wrote a simple Ant buildfile (wsadbuild.xml) which executes these tasks:

    1. create a directory called workspace.temp

    2. use Ant's cvs task to checkout all of my WSAD projects from CVS
    The checkout puts the projects into workspace.temp

    3. use WSAD's projectBuild task to build one of the projects
    When I try to build the projects, I see an error message which says

    "HeadlessWebProjectSettings save bypassed (no projects in workspace)"

    Why does this happen?

    This is the output from the project build:

    C:\build\apps\build>headlessant wsadbuild.xml buildprojects

    C:\build\apps\build>"C:\Program Files\IBM\WebSphere Studio\Application Developer
    \v5.1.1\eclipse\jre\bin\java" -cp "C:\Program Files\IBM\WebSphere Studio\Applica
    tion Developer\v5.1.1\eclipse\startup.jar" org.eclipse.core.launcher.Main -appli
    cation com.ibm.etools.j2ee.ant.RunAnt -data .\workspace.temp -buildfile wsadbuil
    d.xml buildprojects
    HeadlessWorkspaceSettings: INITIAL autoBuild=true maxFile=1048576
    HeadlessWorkspaceSettings: TEMP autoBuild=false maxFile=-1
    HeadlessWebProjectSettings: HeadlessWebProjectSettings save bypassed (no project
    s in workspace)
    Buildfile: wsadbuild.xml

    buildprojects:
    setDebugInfo setDebugInfo: LocalVariable=generate, LineNumber=generate, Source
    File=generate.
    projectBuild ProjectBuild: FlashRemotingSampleEAR not found in Workspace.

    BUILD FAILED
    file:C:/build/apps/build/wsadbuild.xml:77: ProjectBuild: FlashRemotingSampleEAR
    not found in Workspace.

    Total time: 3 seconds
    HeadlessWebProjectSettings: HeadlessWebProjectSettings restore bypassed (linksBu
    ilderCommand was never saved)
    HeadlessWorkspaceSettings: RESTORED autoBuild=true maxFile=1048576
    java.lang.reflect.InvocationTargetException: file:C:/build/apps/build/wsadbuild.
    xml:77: ProjectBuild: FlashRemotingSampleEAR not found in Workspace.
    at com.ibm.etools.ant.extras.ProjectBuild.displayError(ProjectBuild.java
    :138)
    at com.ibm.etools.ant.extras.ProjectBuild.execute(ProjectBuild.java:51)
    at org.apache.tools.ant.Task.perform(Task.java:341)
    at org.apache.tools.ant.Target.execute(Target.java:309)
    at org.apache.tools.ant.Target.performTasks(Target.java:336)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
    nner.java:569)
    at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
    nner.java:493)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.eclipse.ant.core.AntRunner.run(AntRunner.java:464)
    at com.ibm.ant.extras.RunAnt.run(RunAnt.java:27)
    at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa
    der.java:858)
    at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
    at org.eclipse.core.launcher.Main.run(Main.java:747)
    at org.eclipse.core.launcher.Main.main(Main.java:583)
    C:\build\apps\build>
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-23T18:31:12Z  
    I wrote a simple Ant buildfile (wsadbuild.xml) which executes these tasks:

    1. create a directory called workspace.temp

    2. use Ant's cvs task to checkout all of my WSAD projects from CVS
    The checkout puts the projects into workspace.temp

    3. use WSAD's projectBuild task to build one of the projects
    When I try to build the projects, I see an error message which says

    "HeadlessWebProjectSettings save bypassed (no projects in workspace)"

    Why does this happen?

    This is the output from the project build:

    C:\build\apps\build>headlessant wsadbuild.xml buildprojects

    C:\build\apps\build>"C:\Program Files\IBM\WebSphere Studio\Application Developer
    \v5.1.1\eclipse\jre\bin\java" -cp "C:\Program Files\IBM\WebSphere Studio\Applica
    tion Developer\v5.1.1\eclipse\startup.jar" org.eclipse.core.launcher.Main -appli
    cation com.ibm.etools.j2ee.ant.RunAnt -data .\workspace.temp -buildfile wsadbuil
    d.xml buildprojects
    HeadlessWorkspaceSettings: INITIAL autoBuild=true maxFile=1048576
    HeadlessWorkspaceSettings: TEMP autoBuild=false maxFile=-1
    HeadlessWebProjectSettings: HeadlessWebProjectSettings save bypassed (no project
    s in workspace)
    Buildfile: wsadbuild.xml

    buildprojects:
    setDebugInfo setDebugInfo: LocalVariable=generate, LineNumber=generate, Source
    File=generate.
    projectBuild ProjectBuild: FlashRemotingSampleEAR not found in Workspace.

    BUILD FAILED
    file:C:/build/apps/build/wsadbuild.xml:77: ProjectBuild: FlashRemotingSampleEAR
    not found in Workspace.

    Total time: 3 seconds
    HeadlessWebProjectSettings: HeadlessWebProjectSettings restore bypassed (linksBu
    ilderCommand was never saved)
    HeadlessWorkspaceSettings: RESTORED autoBuild=true maxFile=1048576
    java.lang.reflect.InvocationTargetException: file:C:/build/apps/build/wsadbuild.
    xml:77: ProjectBuild: FlashRemotingSampleEAR not found in Workspace.
    at com.ibm.etools.ant.extras.ProjectBuild.displayError(ProjectBuild.java
    :138)
    at com.ibm.etools.ant.extras.ProjectBuild.execute(ProjectBuild.java:51)
    at org.apache.tools.ant.Task.perform(Task.java:341)
    at org.apache.tools.ant.Target.execute(Target.java:309)
    at org.apache.tools.ant.Target.performTasks(Target.java:336)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
    nner.java:569)
    at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
    nner.java:493)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.eclipse.ant.core.AntRunner.run(AntRunner.java:464)
    at com.ibm.ant.extras.RunAnt.run(RunAnt.java:27)
    at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa
    der.java:858)
    at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
    at org.eclipse.core.launcher.Main.run(Main.java:747)
    at org.eclipse.core.launcher.Main.main(Main.java:583)
    C:\build\apps\build>
    Cool, closely resembles the error msg we get:
    C:\Program Files\IBM\WebSphere Studio\wstools\eclipse\plugins\com.ibm.etools.j2e
    e.ant_5.0.1>"C:\Program Files\IBM\WebSphere Studio\eclipse\jre\bin\java" -cp "C:
    \Program Files\IBM\WebSphere Studio\eclipse\startup.jar" org.eclipse.core.launch
    er.Main -consolelog -application com.ibm.etools.j2ee.ant.RunAnt -buildfile Z:\ES
    D\source\esd\LockTest\LockTestJunit\lockTestJunitBuild.xml
    Headless RunAnt started
    RunAnt.run antArgs.length=3
    RunAnt.run about to null HeadlessWorkspaceSettings
    RunAnt.run about to create new HeadlessWorkspaceSettings
    nullTask: HeadlessWebProjectSettings save bypassed (no projects in workspace)
    RunAnt.run DONE create new HeadlessWorkspaceSettings
    RunAnt.runAntCommands args=[Ljava.lang.String;@1d0435b4
    RunAnt.runAntCommands about to create new AntRunner
    RunAnt.runAntCommands DONE create new AntRunner
    RunAnt.runAntCommands args=[Ljava.lang.String;@1d0435b4

    init:
    projectBuild ProjectBuild: LockTestJunit not found in Workspace.
    Z:\ESD\source\esd\LockTest\LockTestJunit\lockTestJunitBuild.xml:17: ProjectBuild
    : LockTestJunit not found in Workspace.
    at com.ibm.ant.extras.ProjectBuild.displayError(ProjectBuild.java:116)
    at com.ibm.ant.extras.ProjectBuild.execute(ProjectBuild.java:46)
    at org.apache.tools.ant.Task.perform(Task.java:217)
    at org.apache.tools.ant.Target.execute(Target.java:184)
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-23T23:30:02Z  
    I wrote a simple Ant buildfile (wsadbuild.xml) which executes these tasks:

    1. create a directory called workspace.temp

    2. use Ant's cvs task to checkout all of my WSAD projects from CVS
    The checkout puts the projects into workspace.temp

    3. use WSAD's projectBuild task to build one of the projects
    When I try to build the projects, I see an error message which says

    "HeadlessWebProjectSettings save bypassed (no projects in workspace)"

    Why does this happen?

    This is the output from the project build:

    C:\build\apps\build>headlessant wsadbuild.xml buildprojects

    C:\build\apps\build>"C:\Program Files\IBM\WebSphere Studio\Application Developer
    \v5.1.1\eclipse\jre\bin\java" -cp "C:\Program Files\IBM\WebSphere Studio\Applica
    tion Developer\v5.1.1\eclipse\startup.jar" org.eclipse.core.launcher.Main -appli
    cation com.ibm.etools.j2ee.ant.RunAnt -data .\workspace.temp -buildfile wsadbuil
    d.xml buildprojects
    HeadlessWorkspaceSettings: INITIAL autoBuild=true maxFile=1048576
    HeadlessWorkspaceSettings: TEMP autoBuild=false maxFile=-1
    HeadlessWebProjectSettings: HeadlessWebProjectSettings save bypassed (no project
    s in workspace)
    Buildfile: wsadbuild.xml

    buildprojects:
    setDebugInfo setDebugInfo: LocalVariable=generate, LineNumber=generate, Source
    File=generate.
    projectBuild ProjectBuild: FlashRemotingSampleEAR not found in Workspace.

    BUILD FAILED
    file:C:/build/apps/build/wsadbuild.xml:77: ProjectBuild: FlashRemotingSampleEAR
    not found in Workspace.

    Total time: 3 seconds
    HeadlessWebProjectSettings: HeadlessWebProjectSettings restore bypassed (linksBu
    ilderCommand was never saved)
    HeadlessWorkspaceSettings: RESTORED autoBuild=true maxFile=1048576
    java.lang.reflect.InvocationTargetException: file:C:/build/apps/build/wsadbuild.
    xml:77: ProjectBuild: FlashRemotingSampleEAR not found in Workspace.
    at com.ibm.etools.ant.extras.ProjectBuild.displayError(ProjectBuild.java
    :138)
    at com.ibm.etools.ant.extras.ProjectBuild.execute(ProjectBuild.java:51)
    at org.apache.tools.ant.Task.perform(Task.java:341)
    at org.apache.tools.ant.Target.execute(Target.java:309)
    at org.apache.tools.ant.Target.performTasks(Target.java:336)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
    nner.java:569)
    at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRu
    nner.java:493)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.eclipse.ant.core.AntRunner.run(AntRunner.java:464)
    at com.ibm.ant.extras.RunAnt.run(RunAnt.java:27)
    at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa
    der.java:858)
    at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
    at java.lang.reflect.Method.invoke(Native Method)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
    at org.eclipse.core.launcher.Main.run(Main.java:747)
    at org.eclipse.core.launcher.Main.main(Main.java:583)
    C:\build\apps\build>
    > When I try to build the projects, I see an error
    > message which says
    >
    > "HeadlessWebProjectSettings save bypassed (no
    > (no projects in workspace)"
    >

    I exchanged email with Barry Searle at IBM.

    Barry told me:

    "putting project files on the filesystem underneath the
    workspace directory does NOT create Eclipse projects."

    In Websphere Studio, projects must be imported into the workspace. This is normally done within Studio's GUI.

    According to Barry, a script can import projects into
    the workspace by using a custom Ant task.

    Barry provided a custom Ant know called WSBCExtImportOp

    The WSBCExtImportOp task will import projects into the workspace.

    IBM may rename this task in the future. Barry told me that the future name will probably be "importProject"

    I hope IBM publishes this Ant task on Alphaworks soon.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-23T23:38:41Z  
    Cool, closely resembles the error msg we get:
    C:\Program Files\IBM\WebSphere Studio\wstools\eclipse\plugins\com.ibm.etools.j2e
    e.ant_5.0.1>"C:\Program Files\IBM\WebSphere Studio\eclipse\jre\bin\java" -cp "C:
    \Program Files\IBM\WebSphere Studio\eclipse\startup.jar" org.eclipse.core.launch
    er.Main -consolelog -application com.ibm.etools.j2ee.ant.RunAnt -buildfile Z:\ES
    D\source\esd\LockTest\LockTestJunit\lockTestJunitBuild.xml
    Headless RunAnt started
    RunAnt.run antArgs.length=3
    RunAnt.run about to null HeadlessWorkspaceSettings
    RunAnt.run about to create new HeadlessWorkspaceSettings
    nullTask: HeadlessWebProjectSettings save bypassed (no projects in workspace)
    RunAnt.run DONE create new HeadlessWorkspaceSettings
    RunAnt.runAntCommands args=[Ljava.lang.String;@1d0435b4
    RunAnt.runAntCommands about to create new AntRunner
    RunAnt.runAntCommands DONE create new AntRunner
    RunAnt.runAntCommands args=[Ljava.lang.String;@1d0435b4

    init:
    projectBuild ProjectBuild: LockTestJunit not found in Workspace.
    Z:\ESD\source\esd\LockTest\LockTestJunit\lockTestJunitBuild.xml:17: ProjectBuild
    : LockTestJunit not found in Workspace.
    at com.ibm.ant.extras.ProjectBuild.displayError(ProjectBuild.java:116)
    at com.ibm.ant.extras.ProjectBuild.execute(ProjectBuild.java:46)
    at org.apache.tools.ant.Task.perform(Task.java:217)
    at org.apache.tools.ant.Target.execute(Target.java:184)
    > init:
    > projectBuild ProjectBuild: LockTestJunit not found
    > in Workspace.
    > Z:\ESD\source\esd\LockTest\LockTestJunit\lockTestJunit
    > uild.xml:17: ProjectBuild
    > : LockTestJunit not found in Workspace.

    It sounds like we are writing similar Ant scripts.

    Please contact me via email, sullivan dot sean at menlolog dot c o m
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-03-24T20:16:54Z  
    > init:
    > projectBuild ProjectBuild: LockTestJunit not found
    > in Workspace.
    > Z:\ESD\source\esd\LockTest\LockTestJunit\lockTestJunit
    > uild.xml:17: ProjectBuild
    > : LockTestJunit not found in Workspace.

    It sounds like we are writing similar Ant scripts.

    Please contact me via email, sullivan dot sean at menlolog dot c o m
    I am getting an error when I use the projectBuild task.

    "ProjectBuild: FlashRemotingSampleEAR is not open"

    The source code for the projectBuild task is online in Barry Searle's article:

    http://www-106.ibm.com/developerworks/websphere/library/techarticles/0203_searle/searle3.html
    The Ant task uses the org.eclipse.core.resources.IProject
    interface to access the project.

    It appears that the Ant task does not invoke IProject.open

    I hope IBM can provide a fix for this bug.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT - importProject now working (and projects opened)

    ‏2004-04-07T19:35:44Z  
    I am getting an error when I use the projectBuild task.

    "ProjectBuild: FlashRemotingSampleEAR is not open"

    The source code for the projectBuild task is online in Barry Searle's article:

    http://www-106.ibm.com/developerworks/websphere/library/techarticles/0203_searle/searle3.html
    The Ant task uses the org.eclipse.core.resources.IProject
    interface to access the project.

    It appears that the Ant task does not invoke IProject.open

    I hope IBM can provide a fix for this bug.
    I believe you now have this working. if not, please let me know since whenever I run the "importProjects" (WSBCExtImportOp), the project is imported and opened.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-04-21T15:39:21Z  
    > When I try to build the projects, I see an error
    > message which says
    >
    > "HeadlessWebProjectSettings save bypassed (no
    > (no projects in workspace)"
    >

    I exchanged email with Barry Searle at IBM.

    Barry told me:

    "putting project files on the filesystem underneath the
    workspace directory does NOT create Eclipse projects."

    In Websphere Studio, projects must be imported into the workspace. This is normally done within Studio's GUI.

    According to Barry, a script can import projects into
    the workspace by using a custom Ant task.

    Barry provided a custom Ant know called WSBCExtImportOp

    The WSBCExtImportOp task will import projects into the workspace.

    IBM may rename this task in the future. Barry told me that the future name will probably be "importProject"

    I hope IBM publishes this Ant task on Alphaworks soon.
    were can I download these custom tag called "WSBCExtImportOp"??? Its very important for me!

    thx,
    pitti
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-04-23T14:06:09Z  
    were can I download these custom tag called "WSBCExtImportOp"??? Its very important for me!

    thx,
    pitti
    you cannot download the "importProject" or "workspaceBuild" etc tasks from any public site, but just send me an EMail asking for them and I will be happy to send them to you.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-05-17T12:40:10Z  
    Update: we finally got an EAR file built via an ANT script outside of WSAD, and is checked out through ClearCase; here is a summary of major points:
    1) Do not use WSAD as the compiler in the ant script; use WAS. (You COULD use 1)WAS, 2)WSAD antTasks, 3)ANT built-in tasks, and/or 4)the headless ant approach; we wound up using the first approach.)
    2) Install WAS in a directory with no spaces, e.g. C:/WAS_51. This will save you many headaches.
    3) Do not use the built-in ejbdeploy ant task, instead use ejbdeploy.bat that comes with WAS.
    4) Found a glitch in ejbdeploy.bat where it does not pick up the manifest files properly from the build directory; it instead attempts to read them from the original source directory. This is no big deal except that ejbdeploy.bat will also write the rmi class files into the source directory rather than the build directory; makes it very difficult to reconcile all the class files needed for the output EAR. We got around this by a hack that renames the source directory before invoking the ejbdeploy.bat, then renaming it back once the rmi compile is complete. (Where the "source" directory is a snapshot checked out from ClearCase.)
    5. For checking the source out of clearcase, set up a snapshot view and use the commands contained in Diane Bowker's article for checking out of clearcase.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-05-25T14:32:52Z  
    We are using EARs, EJBs, and Java projects.
    I'd assume that your Foo project would work fine with headless ant, but you might just want to use regular ant (I guess that would be ant WITH a head?).

    The reason I think that our headless ant is not working is that our source code is in a ClearCase VOB, and the VOB is not directly physically under a defined WorkSpace. Barry said that he was looking into whether or not headless ant has an issue with that type of set up, i.e. where the projects are in a different physical area from the workspace. No feedback as yet, though.

    There is also a product out there (name escapes me but you can find a link to it on the eclipse plug-ins page) that will build outside of websphere. I haven't had time to dink with it, though.
    > > Yeah, they kind of did not mention that you have
    > to
    > > tailor the runAnt.bat script, eh?
    >
    > True. I had to tailor runAnt.bat for my local
    > environment.
    >
    > > Our problem (right now) is that it does not appear
    > > that the tasks will work properly if the source
    > code
    > > is not directly beneath the workspace. So, while
    > we
    > > can get the "echo" demo script to work, nothing
    > else
    > > will.
    >
    > Which type of project are you using?
    > Java projects?
    > Web application projects?
    > EAR projects?
    >
    > I have a Java project called "Foo"
    >
    > Foo contains a source folder "src"
    >
    > My Java source files are in src.
    >
    > Will I be able to use headless ant to build this
    > code?

    > I'd assume that your Foo project would work fine with
    > headless ant, but you might just want to use regular
    > ant (I guess that would be ant WITH a head?).

    Funny - but it is not Ant that is running 'headless' it is WSAD that is the headless horseman in this configuration.

    FYI - headless refers to the lack of a GUI - Ant is a command line utility, it is by nature GUI-less, but in this environment it is WSAD that is getting the head (GUI) removed.

    And just to bore you with details: try running 'runAnt.bat' while WSAD is running to see what happens (or doesn't happen). The runAnt will not function as expected. My guess - Eclipse will see that it is already running and exit very quietly - not what one expects!
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-05-25T14:50:39Z  
    Update: we finally got an EAR file built via an ANT script outside of WSAD, and is checked out through ClearCase; here is a summary of major points:
    1) Do not use WSAD as the compiler in the ant script; use WAS. (You COULD use 1)WAS, 2)WSAD antTasks, 3)ANT built-in tasks, and/or 4)the headless ant approach; we wound up using the first approach.)
    2) Install WAS in a directory with no spaces, e.g. C:/WAS_51. This will save you many headaches.
    3) Do not use the built-in ejbdeploy ant task, instead use ejbdeploy.bat that comes with WAS.
    4) Found a glitch in ejbdeploy.bat where it does not pick up the manifest files properly from the build directory; it instead attempts to read them from the original source directory. This is no big deal except that ejbdeploy.bat will also write the rmi class files into the source directory rather than the build directory; makes it very difficult to reconcile all the class files needed for the output EAR. We got around this by a hack that renames the source directory before invoking the ejbdeploy.bat, then renaming it back once the rmi compile is complete. (Where the "source" directory is a snapshot checked out from ClearCase.)
    5. For checking the source out of clearcase, set up a snapshot view and use the commands contained in Diane Bowker's article for checking out of clearcase.
    > Update: we finally got an EAR file built via an ANT
    > script outside of WSAD, and is checked out through
    > ClearCase; here is a summary of major points:
    ...
    > 2) Install WAS in a directory with no spaces, e.g.
    > C:/WAS_51. This will save you many headaches.

    GREAT POINT - the spaces in the typical 'Program Files' and in IBM's 'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many headaches. Perhaps in the next century (2100) we will be using an OS that understand the basic parsing of our language is written with a space char. and that context is very important to parsing - we can only hope!
    ...
    > 5. For checking the source out of clearcase, set up a
    > snapshot view and use the commands contained in Diane
    > Bowker's article for checking out of clearcase.

    Can you post a detailed description of how you accomplished this great task?

    A pointer to Diane Bowker's article please?

    Thanks
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-05-25T20:08:03Z  
    "Headless Ant" is described in this article:

    http://www-106.ibm.com/developerworks/websphere/library/techarticles/020
    3_searle/searle1.html

    Unfortunately, Barry Searle's article appears to be out of date.

    The Online Help in WSAD 5.1.1 describes these Ant tasks:

    projectBuild
    getJavacErrorCount
    getProjectData
    setDebugInfo
    AppClientExport
    EARExport
    UtilJar
    WARExport
    AccessBeanRegeneration
    EJBDeploy
    EJBExport

    I found the runAnt.bat file in this directory:

    C:\Program Files\IBM\WebSphere Studio\Application
    Developer\v5.1.1\wstools\eclipse\plugins\com.ibm.etools.j2ee.ant_5.1.1

    When I execute runAnt.bat from a command prompt, it reports this error:

    Unknown argument: -consolelog

    Is this a flaw in IBM's batch file?

    > When I execute runAnt.bat from a command prompt, it
    > reports this error:
    >
    > Unknown argument: -consolelog

    Barry Searle's Install Instructions - (sent via email) appear to be aware of this issue and instruct you to remove the '-consolelog' option from the command RunAnt.bat.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-06-03T18:32:32Z  
    > Update: we finally got an EAR file built via an ANT
    > script outside of WSAD, and is checked out through
    > ClearCase; here is a summary of major points:
    ...
    > 2) Install WAS in a directory with no spaces, e.g.
    > C:/WAS_51. This will save you many headaches.

    GREAT POINT - the spaces in the typical 'Program Files' and in IBM's 'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many headaches. Perhaps in the next century (2100) we will be using an OS that understand the basic parsing of our language is written with a space char. and that context is very important to parsing - we can only hope!
    ...
    > 5. For checking the source out of clearcase, set up a
    > snapshot view and use the commands contained in Diane
    > Bowker's article for checking out of clearcase.

    Can you post a detailed description of how you accomplished this great task?

    A pointer to Diane Bowker's article please?

    Thanks
    > Can you post a detailed description of how you
    > accomplished this great task?
    >
    > A pointer to Diane Bowker's article please?
    Here is Diane's article:
    http://www-106.ibm.com/developerworks/websphere/library/techarticles/0404_bowker/0404_bowker1.html

    And just out of curiousity, why is poor Barry having to support headless WSAD via email? Wouldn't some updated instructions and anttasks on devworks do the trick?

    Also curious to see more detailed description of how the great task was accomplished.

    Cheers
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-06-08T22:02:04Z  
    > Update: we finally got an EAR file built via an ANT
    > script outside of WSAD, and is checked out through
    > ClearCase; here is a summary of major points:
    ...
    > 2) Install WAS in a directory with no spaces, e.g.
    > C:/WAS_51. This will save you many headaches.

    GREAT POINT - the spaces in the typical 'Program Files' and in IBM's 'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many headaches. Perhaps in the next century (2100) we will be using an OS that understand the basic parsing of our language is written with a space char. and that context is very important to parsing - we can only hope!
    ...
    > 5. For checking the source out of clearcase, set up a
    > snapshot view and use the commands contained in Diane
    > Bowker's article for checking out of clearcase.

    Can you post a detailed description of how you accomplished this great task?

    A pointer to Diane Bowker's article please?

    Thanks
    Just migrating to websphere/studio and I have to say, the ANT support in
    WSAD should cause IBM serious embarrassment.

    I read with disappointment the instructions about how to run a "headless"
    WSAD to build studio projects with ant. Now... perhaps I have been
    misguided these past years (not), but I thought the point behind using ant
    was so that you could create repeatable builds with MINIMAL external
    resource requirements & dependencies? I want all of my developers/build
    mgrs/release mgrs/etc to use the same ant scripts to build a project. Those
    builds should NOT be dependent in any way shape or form on how some IDE is
    installed or configured. That is the whole point of a build script!

    Extend the classpath requirements for running ant to include some websphere
    specific tasks, fine, that is expected... but requiring an installed
    instance of the IDE? Give me a break.

    Please someone tell me it isn't really this way... For a high $ system from
    a major enterprise shop, I expected something far more professional.
    --
    Zed

    "davidakoontz" <dakoontz@yahoo.com> wrote in message
    news:935428578.1085496639432.JavaMail.wasadmin@swg3ws006...
    > > Update: we finally got an EAR file built via an ANT
    > > script outside of WSAD, and is checked out through
    > > ClearCase; here is a summary of major points:
    > ..
    > > 2) Install WAS in a directory with no spaces, e.g.
    > > C:/WAS_51. This will save you many headaches.
    >
    > GREAT POINT - the spaces in the typical 'Program Files' and in IBM's
    'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many
    headaches. Perhaps in the next century (2100) we will be using an OS that
    understand the basic parsing of our language is written with a space char.
    and that context is very important to parsing - we can only hope!
    > ..
    > > 5. For checking the source out of clearcase, set up a
    > > snapshot view and use the commands contained in Diane
    > > Bowker's article for checking out of clearcase.
    >
    > Can you post a detailed description of how you accomplished this great
    task?
    >
    > A pointer to Diane Bowker's article please?
    >
    > Thanks

  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-06-09T15:53:14Z  
    Just migrating to websphere/studio and I have to say, the ANT support in
    WSAD should cause IBM serious embarrassment.

    I read with disappointment the instructions about how to run a "headless"
    WSAD to build studio projects with ant. Now... perhaps I have been
    misguided these past years (not), but I thought the point behind using ant
    was so that you could create repeatable builds with MINIMAL external
    resource requirements & dependencies? I want all of my developers/build
    mgrs/release mgrs/etc to use the same ant scripts to build a project. Those
    builds should NOT be dependent in any way shape or form on how some IDE is
    installed or configured. That is the whole point of a build script!

    Extend the classpath requirements for running ant to include some websphere
    specific tasks, fine, that is expected... but requiring an installed
    instance of the IDE? Give me a break.

    Please someone tell me it isn't really this way... For a high $ system from
    a major enterprise shop, I expected something far more professional.
    --
    Zed

    "davidakoontz" <dakoontz@yahoo.com> wrote in message
    news:935428578.1085496639432.JavaMail.wasadmin@swg3ws006...
    > > Update: we finally got an EAR file built via an ANT
    > > script outside of WSAD, and is checked out through
    > > ClearCase; here is a summary of major points:
    > ..
    > > 2) Install WAS in a directory with no spaces, e.g.
    > > C:/WAS_51. This will save you many headaches.
    >
    > GREAT POINT - the spaces in the typical 'Program Files' and in IBM's
    'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many
    headaches. Perhaps in the next century (2100) we will be using an OS that
    understand the basic parsing of our language is written with a space char.
    and that context is very important to parsing - we can only hope!
    > ..
    > > 5. For checking the source out of clearcase, set up a
    > > snapshot view and use the commands contained in Diane
    > > Bowker's article for checking out of clearcase.
    >
    > Can you post a detailed description of how you accomplished this great
    task?
    >
    > A pointer to Diane Bowker's article please?
    >
    > Thanks

    > Just migrating to websphere/studio and I have to say,
    > the ANT support in
    > WSAD should cause IBM serious embarrassment.
    >
    > I read with disappointment the instructions about how
    > to run a "headless"
    > WSAD to build studio projects with ant. Now...
    > perhaps I have been
    > misguided these past years (not), but I thought the
    > point behind using ant
    > was so that you could create repeatable builds with
    > MINIMAL external
    > resource requirements & dependencies? I want all of
    > my developers/build
    > mgrs/release mgrs/etc to use the same ant scripts to
    > build a project. Those
    > builds should NOT be dependent in any way shape or
    > form on how some IDE is
    > installed or configured. That is the whole point of
    > a build script!
    >
    > Extend the classpath requirements for running ant to
    > include some websphere
    > specific tasks, fine, that is expected... but
    > requiring an installed
    > instance of the IDE? Give me a break.
    >
    > Please someone tell me it isn't really this way...
    > For a high $ system from
    > a major enterprise shop, I expected something far
    > more professional.
    > --
    > Zed

    If it's any consolation, with some help from Barry (latest "patches" to the antextras.jar) I was able to get an ant build to work ok. Hopefully he can get that released to the general public soon.

    Agreed that there should be no dependency on the development environment. Currently it depends on the AntRunner within the eclipse plugins provided by WSAD, ant it literally starts up Eclipse in headless mode. Ideally IBM would simply ship the AntTasks.jar, the dependencies it has and some doc on how to use the custom tasks (see BEA's doc on using their Ant tasks for compiling, packaging and delploying). I think the main sticking point at the moment is the tight coupling with the dev environment - ie, the dependencies and metadata that the dev environment uses for it's builds and deployment features are in a proprietary format that only the dev environment can interpret, hence bootstrapping the whole thing to get a simple compile to work.

    Perhaps a lighter weight "build" environment could be created that understands the metadata and dependency tree of the workspace projects?

    If you do have suggestions for improvement, they are listening and Barry can add you to his mail list for this effort if you are interested.
  • SystemAdmin
    SystemAdmin
    6042 Posts

    Re: Anyone using Headless ANT

    ‏2004-06-09T16:11:54Z  
    Just migrating to websphere/studio and I have to say, the ANT support in
    WSAD should cause IBM serious embarrassment.

    I read with disappointment the instructions about how to run a "headless"
    WSAD to build studio projects with ant. Now... perhaps I have been
    misguided these past years (not), but I thought the point behind using ant
    was so that you could create repeatable builds with MINIMAL external
    resource requirements & dependencies? I want all of my developers/build
    mgrs/release mgrs/etc to use the same ant scripts to build a project. Those
    builds should NOT be dependent in any way shape or form on how some IDE is
    installed or configured. That is the whole point of a build script!

    Extend the classpath requirements for running ant to include some websphere
    specific tasks, fine, that is expected... but requiring an installed
    instance of the IDE? Give me a break.

    Please someone tell me it isn't really this way... For a high $ system from
    a major enterprise shop, I expected something far more professional.
    --
    Zed

    "davidakoontz" <dakoontz@yahoo.com> wrote in message
    news:935428578.1085496639432.JavaMail.wasadmin@swg3ws006...
    > > Update: we finally got an EAR file built via an ANT
    > > script outside of WSAD, and is checked out through
    > > ClearCase; here is a summary of major points:
    > ..
    > > 2) Install WAS in a directory with no spaces, e.g.
    > > C:/WAS_51. This will save you many headaches.
    >
    > GREAT POINT - the spaces in the typical 'Program Files' and in IBM's
    'WebShpere Studio' pathnames will cause DOS/Windows batch files & you many
    headaches. Perhaps in the next century (2100) we will be using an OS that
    understand the basic parsing of our language is written with a space char.
    and that context is very important to parsing - we can only hope!
    > ..
    > > 5. For checking the source out of clearcase, set up a
    > > snapshot view and use the commands contained in Diane
    > > Bowker's article for checking out of clearcase.
    >
    > Can you post a detailed description of how you accomplished this great
    task?
    >
    > A pointer to Diane Bowker's article please?
    >
    > Thanks

    I tried to reply last night, but that reply seems to be 'lost'.

    Yes, you CURRENTLY need a Studio install to run the 'headless' Studio AntTasks (projectBuild, WarExport, ejbDeploy, etc). Many customers have complained that they dont want the cost or size of a full Studio install in order to be able to do production builds. I cannot promise/commit/comment about unshipped/unannounced product, but I can say that this complaint has been clearly heard.

    While we are at it, others have complained about builds being limited to those platforms on which Studio is supported, and want to be able to do builds wherever WebSphere AppServer runs. Again, I cannot promise/commit/comment on unannounced/unshipped product, but that complaint has also been very clearly heard.

    In the meantime, anyone having any problems running Studio v5.0/5.1 Ant builds, or AppServer v5.0/5.1 Ant deploys, should contact me. I have an unofficial TechPreview of new build AntTasks (importProject, get/setClasspathVariable, etc) and new deploy AntTask scriptlets (setAttribute, etc) which works with v5.0/5.1.