- This topic has 6 replies, 2 voices, and was last updated 20 years, 10 months ago by Riyad Kalla.
-
AuthorPosts
-
patrick.dobbs@rap-x.comMemberI’m working on an existing project with a CVS repository structure like this:
– src
– lib
– webIt has an ant build.xml which copies web to a new location, then compiles src into web/WEB-INF and copies /lib into the same folder.
This directory structures seems incompatible with what MyEclipse needs to function, but I cannot change the directory structure of the CVS project, and I want to use the same build.xml as everyone else, to avoid duplication or divergent practise.
Please advise me how I can work with this structure with MyEclipse. Thanks.
Riyad KallaMemberRobert,
MyEclipse is very happy if you rigth click on your project root and set your MyEclipse-Web settings to have a webroot of “web” and make sure in your build settings that your source path is “src” and your output path is “web/WEB-INF/classes” (I’m guessing you made a mistake in your post saying that you compile /src into WEB-INF… cause well that’s just wrong 😉Anyway, if your ant script moves directories around out from under MyEclipse into alternative structures… that’s ok, but I’m not sure from your post what you are hoping MyEclipse would do with this new directory structure…
If you are talking about deployment (as development would work fine with the above setting) then yes you are right, you really need to just keep your web application in the format of an exploded war file and work with it that way. This is a best practice and not by any means some invention of MyEclipse.
Let me know more specifically what MyEclipse isn’t doing that you need it to.
patrick.dobbs@rap-x.comMemberMy main question is whether I can edit and debug JSPs in my existing /web/ directory, bearing in mind that this only becomes a valid expanded WAR after it is copied to the build folder, and merged with /lib/ and /classes/ .
My current workflow is to edit in /web/ then run ANT compile which copies the edited JSP to the build folder, and refreshes the WebApp. How should I adapt this workflow to benefit from MyEclipse jsp debugging?
Riyad KallaMemberFor debugging to work properly you will need to deploy your app into your application server exactly as MyEclipse sees it. So whatever your webroot is in MyEclipse, needs to be your webroot in the application server. With that said, I think you should be ok, here is my reasoning (Please Michael/Scott correct any mistakes):
In MyEclipse your app looks like this:
/src <-- class source /lib <-- jars that are needed /web <-- webroot /WEB-INF/classes <-- compile target for your /src files
Now assuming you run your ant script to deploy your app as is to your application server (say Tomcat) IIRC as long as your deployed app mirrors what MyEclipse sees, you should be able to start Tomcat (or whatever) up in debug mode and connect to it and debug your app. I believe the key here is that the two look the same, so when MyEclipse attempts to lookup source for a file that Tomcat is processing, it can find it using the same path names/location that Tomcat sees.
So i guess the only change you really need to make is to not use the deploy mechanism in MyEclipse, have your ant script do it for you, but then launch/debug your app from MyEclipse.
Also your context’s will need to match I’m pretty sure since MyEclipse will attempt to look for the same context name it sees on the application server. So if you named your context in MyEclipse “pickels” you should have your ant script deploy to the “webapps/pickels” directory in your container.
patrick.dobbs@rap-x.comMemberThanks very much for your suggestions. I’m still a little unclear about precisely what to do next, but I’ll do some messing about. I guess the issues I face are very common. The source code setup we have is in line with that recommended by the Tomcat people: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/source.html – so hopefully your suggestions will be more widely useful.
Riyad KallaMemberThank you for the link, I see what you mean. It also gives a clear test case to work with. I’ll forward this on to someone more in the know about this stuff than myself and see if we support this.
Hang in there!
Riyad KallaMemberI just talked with Scott about this, and he says that everything should be kosher as long as MyEclipse is running fine and can find the code, then when you run the application server and start to debug your app, everything should work.
-
AuthorPosts