7

I was wondering if it was possible to separate my javascript libraries in different eclipse project and then import them in another dynamic web project like I would normally do for regular java sub-projects ?

This answer : Link JavaScript project with Java project in Eclipse is what I want to do however I dont really like the answer ... I'd rather link to workspace projects rather than directly rely on the FileSystem .

It seems the JSDT ( http://www.eclipse.org/webtools/jsdt/ ) "adds a JavaScript project type and perspective to the Eclipse Workbench" but how do you use / import / link these JS projects in your java project ?

Thanks for your help.

1 Answer 1

0

Add it to the JavaScript Include Path of your web project from the relevant Property Page:

JavaScript/Include Path property page for the project 'JS'

3
  • thank you for your help. I had hoped this would work for me but unfortunately, the JS project does not get included at deployment time == the js files are not copied to the deployment folder when testing my webapp on tomcat from eclipse for example ... I also tried to add the JS project to my Java project in deployment assembly but its not there ... so the js files are never copied to the target server directory. Any other idea ?
    – azpublic
    Feb 2, 2013 at 16:46
  • 1
    I had hoped this would work but the JS project never gets deployed to the target Tomcat server.woops ... double post
    – azpublic
    Feb 2, 2013 at 16:48
  • 1
    No, deployment as a web app only pulls in other projects as .jars into the WEB-INF/lib folder. If you want JS in your web app, it needs to be in the WebContent folder itself (or another defined root) to be sent to the browser.
    – nitind
    Feb 2, 2013 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.