History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WW-1251
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Claus Ibsen
Reporter: Eric Molitor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
WebWork

Running ant new in webapps fails

Created: 18/Mar/06 01:57 PM   Updated: 21/Mar/06 01:35 PM
Component/s: Misc
Affects Version/s: 2.2.2
Fix Version/s: 2.2.2

Environment: WebWork 2.2.2-RC1.zip downloaded from opensymphony/webwork


 Description  « Hide
When trying to create a new project by running ant new in webapps, ant fails looking for webapps/blank/blank.iml (which is missing).

touching webapps/blank/blank.iml works around the issue.

 All   Comments   Change History      Sort Order:
Claus Ibsen - [19/Mar/06 01:44 AM ]
Hmm works out of the box on my Windows computer, with the source checked out from CVS.

What OS, java and ant version are you using?

This is what it created when I typed the name 'claus'

webapps\claus
26.727 claus.iml
       src

Claus Ibsen - [19/Mar/06 01:54 AM ]
It fails in the RC1.zip file on my Windows, ant 1.6.5 and java 1.4.2

C:\sletmig2\webapps>ant new
Buildfile: build.xml

new:
     [echo]
     [echo] +=============================================================+
     [echo] | -- Create a new web application -- |
     [echo] +=============================================================+
     [echo]

[input] Enter the name of your new application [myapp]?
santa
     [echo] Creating 'santa' web application...
     [copy] Copying 7 files to C:\sletmig2\webapps\santa

BUILD FAILED
C:\sletmig2\webapps\build.xml:129: Warning: Could not find file C:\sletmig2\webapps\blank\blank.iml to copy.

tm_jee - [19/Mar/06 02:52 AM ]
i think idea's *.iml files are not copied over when we do an ant "dist",

in build.xml

<macrodef name="webapp">
        <attribute name="name"/>
        <sequential>
            <mkdir dir="${dist}/webapps/@{name}/src"/>
            <copy todir="${dist}/webapps/@{name}/src">
                <fileset dir="webapps/@{name}/src" includes="**/**"/>
            </copy>
        </sequential>
    </macrodef>

should instead be, i guess, ...

<macrodef name="webapp">
        <attribute name="name"/>
        <sequential>
            <mkdir dir="${dist}/webapps/@{name}/src"/>
            <copy todir="${dist}/webapps/@{name}">
                <fileset dir="webapps/@{name}/" includes="*.iml" />
            </copy>
            <copy todir="${dist}/webapps/@{name}/src">
                <fileset dir="webapps/@{name}/src" includes="**/**"/>
            </copy>
        </sequential>
    </macrodef>


tm_jee - [19/Mar/06 03:08 AM ]
Fixed in cvs head, it should be working now. Kindly review thx. :-)

Claus Ibsen - [19/Mar/06 04:02 AM ]
Toby

+1 looks good to me. I would have done the same.

Would be nice though if we provided Eclipse project files also ;)

Eric Molitor - [19/Mar/06 09:17 AM ]
Works fine now but is this the direction that it should be going? Elsewhere the project files are not included for the distributable. I do like the idea of including the project file but I think that Claus is right, if idea projects files are included then an ant script and an eclipse project file should probably be included too.

Rainer Hermanns - [19/Mar/06 09:59 AM ]
Hmmm...
I think the task should be changed to only include the "template" project definition for the create new task (blank.iml).
All other project definitions should be left out of the distribution.
If anyone could provide Eclipse project files we can add them there as well to allow users getting started really fast.

What do you think?

Eric Molitor - [19/Mar/06 10:40 AM ]
I agree that it should be limited to the template projects. Now you'll just have to find an eclipse user to mock up a project file :) (I usually use IDEA)

Rainer Hermanns - [19/Mar/06 11:20 AM ]
Reopened, still subject of discussion

Claus Ibsen - [19/Mar/06 11:50 AM ]
I'm forced to use Eclipse at work, so I can create the Eclipse project files if we should ship that too in blank.

What about the Qucikstart app. Could it benefit from eclipse project files too?

tm_jee - [20/Mar/06 10:59 AM ]
sounds good, so i guess we've come to a conclusion to only include the Intellij and eclipse's ide related configuration files to the template project. I'll wait for Claus to have the eclipse project files in and work on this issue. Or maybe Claus would like to take over, it would be fine for me as well. :-)

Rainer Hermanns - [20/Mar/06 12:34 PM ]
Done for IDEA.. so the task no longer fails...
Assigning this to Claus to add the Eclipse project files

Claus Ibsen - [20/Mar/06 03:03 PM ]
Okay Eclipse .classpath files added when user performs ant new target

Claus Ibsen - [21/Mar/06 01:33 AM ]
The IDEA file is a idea module lib file, so you need to create your own project and then import this file.

The same situation for Eclipse. You create a new project and Eclipse will automatically read the .classpath file and have it setup.
Should we also supply a .project file for Eclipse?

I'll look into adding one tonight.

Claus Ibsen - [21/Mar/06 01:26 PM ]
Hmm the following echo info doesn't seem right

+=============================================================+
| -- Your Web Application was created successfully! -- |
| |
| Now you should be able to cd to your application and run: |
| > ant build -Dwebapp=shark |
+=============================================================+

I have WW in c:\projects\webwork
I am in c:\project\webwork\webapps now where I did ant new and typed 'shark'.

So If I cd to my application

cd shark
ant build -Dwebapp=shark

C:\project\webwork\webapps\shark>ant build -Dwebapp=shark
Buildfile: build.xml does not exist!
Build failed

I must ofcourse do it from the webapps folder:

C:\project\webwork\webapps>ant build -Dwebapp=shark
Buildfile: build.xml

build:
    [mkdir] Created dir: C:\project\webwork\webapps
    [mkdir] Created dir: C:\project\webwork\webapps
     [copy] Copying 6 files to C:\project\webwork\w
    [javac] Compiling 1 source file to C:\project\w
      [war] Building war: C:\project\webwork\webapp
      [war] Warning: selected war files include a W

BUILD SUCCESSFUL



Claus Ibsen - [21/Mar/06 01:35 PM ]
Okay added Eclipse .project file and fixed wrong echo info