- This topic has 7 replies, 2 voices, and was last updated 18 years, 11 months ago by Riyad Kalla.
-
AuthorPosts
-
myeclipsedougMemberSpent several hours trying to figure out how to configure a project with “Link Additional Source to Project” so that *.sql files are copied to /WEB-INF/classes when running “project deployment”.
Environment
Eclipse 3.1.1
MyEclipseIDE 4.0.3Java Project “XYZ” (SQL is in this project):
Source = XYZ/common/javasource
Source = XYZ/common/config/sqlJ2EE Web Project “ABC”:
Source = ABC/webapp/WEB-INF/classes
Source = ABC/sql (displays due to “link additional source to project”)ABC references project XYZ. All class files from XYZ are deployed, but the SQL is not.
What am I missing? Thanks for the help.
Riyad KallaMemberThe two source folders you have in project XYZ are going to get compiled into a single output dir, like /bin
Then in your ABC web project, just make sure it depends on XYZ and set your deployment to Smart Deployment. Then use an exploded deployment and all the output from XYZ is merged into ABC’s output dir, which happens to be WEB-INF/classes
myeclipsedougMemberrkalaa, thanks for the response.
I did exactly as you described, but the files are not copied to the WEB-INF/classes directory. One point I probably didn’t make clear is:
the files in the sql directory are*.sql files, not *.java files.Each of the source files is configured:
Inluded: (All)
Excluded: (None)Will the IDE only deploy “compiled” class files? Or can it deploy any type of file? I have ABC dependant on XYZ, and have the Smart Deployment radio button selected. Also, using exploded deployment option.
Looking forward to your reply.
Riyad KallaMemberthe files in the sql directory are*.sql files, not *.java files.
That’s OK, as long as this folder is marked as a “Source” folder, Eclipse “compiles” them by copying them directly into the output dir. This is the same way it handles properties files.
Will the IDE only deploy “compiled” class files? Or can it deploy any type of file?
It will support any type.
Doug,
Just to make sure things are suppose to work as is, I create 2 new projects:
TestJava (Java Project that uses separate /src and /bin dirs for compiling)
TestWeb (Web Project)I create a package, com.test in TestJava, and add 3 files: one.sql, two.sql, three.sql
Then I went to TestWeb, editing the project properties and added TestJava to the Build Path and marked it on the Project References section as well. I then made just to set my global deployment setting to Smart and maed sure my prjoect wasn’t overriding that setting.
Then I created an exploded deployment to Tomcat, and bam, all the files were there, merged into the /classes directory.
myeclipsedougMemberTestJava (Java Project that uses separate /src and /bin dirs for compiling)
Maybe the problem is using the same directories for “src” and “bin”? I have:
Source folders on build path:
TestJava/DocServices/javasource
TestJava/DocServices/common/config/sql
TestJava/DocServices/common/config/xmlDefault output folder:
TestJava/DocServices/javasourceThen I went to TestWeb, editing the project properties and added TestJava to the Build Path
Same.
and marked it on the Project References section as well.
Same.
I then made just to set my global deployment setting to Smart
Same.
and made sure my prjoect wasn’t overriding that setting.
Same.
BTW, I tried referencing the sql & xml directories in Java Build Path > Libraries… that didn’t work either.
Riyad KallaMemberTry changing your TestJava project to output to TestJava/bin directory, that might be it.
myeclipsedougMemberYep, you were right. Changing output worked. Thanks rkalla.
Riyad KallaMemberGlad it is working now.
-
AuthorPosts