AppEngine with Eclipse - Common war/ resources - eclipse

I have been creating Google AppEngine projects using Eclipse SDK 3.6.1.
In all of the projects I have a StyleSheet default.css (all seperate copies) that I have in the war folder.
I would like to keep this file in one place to be included in all of the projects.
I have created a copy in the workspace folder.
I have tried linking the file into the war folder, it shows up as a linked file, I can edit it, and all looks fine.
When I run the application I can see by the webpage created that it is not recognizing the linked file.
I hope that I am missing something simple, I do not like keeping multiple copies of a common resource.
Any ideas?
Thanks,
RRaney

Creating a symbolic link to the file will do the job.
For example, on a Windows 7/Vista machine, run a command like this from the shell (as an administrator) to link two folders:
mklink /D C:\workspace\YetAnotherAppEngineProject\war\shared C:\workspace\SharedResourcesProject\shared
I assume that when you wrote "I have tried linking the file into the war folder" you meant that you tried linking a file/folder into the war folder using Eclipse's linked file/folder functionality. These links are limited to the Eclipse IDE and managed by it (int the .project file) - the Google App Engine runtime doesn't recognize them since it accesses the file system directly and not through Eclipse.
A symbolic link is done at the file-system level, and Google App Engine will recognize and respect it properly.
To create a symbolic link, use the "ln" shell command on Linux. On Windows Vista/7 use "mklink" (earlier Windows versions only have "hard links" which are not as nice for this purpose but should also get the job done, see the "linkd" command).

Have you tried "Static Files and Resource Files"?

Related

How do you make linked resources in Eclipse metadata system-independent

I use eclipse to develop my project, with git. I use 2 different system : Windows and Linux. Sometimes I work on Win, sometimes on Linux.
In my project I have a linked resources to a Google Drive folder.
On windows, the folder is D:\GoogleDrive and on Linux /mysuer/GDrive.
I configured the linked resources under windows. So in my .project I have a direct reference to D:\GoogleDrive\myfolder.
So, if I commit the .project, when I checkout under linux, I will have the path relative to windows.
I think may be I can ignore the .project but I don't know it is really better. What I risk to lose ?
What do you do yourself ?
Thanks
If you don't generate the project files and do settings that you want the same on all development machines like code style settings and so on, it is perfectly valid to check in the IDE metadata.
You should just leverage the Feature "Path Variables" that is provided by IntelliJ IDEA and now also Eclipse: http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fcpathvars.htm
You then just set this path variable in your local Eclipse workspaces and define your linked resource relative to this path variable as the linked doku describes.

Eclipse search directories outside workspace?

I'm trying to search folders and files outside the workspace in Eclipse 3.0.2 on Windows 7. These links helped:
http://eclipse.dzone.com/articles/5-best-eclipse-plugins-system
https://bugs.eclipse.org/bugs/show_bug.cgi?id=192767
Unfortunately I can only get Desktop Search to work, not System Search. I've tried both the nokia system search download links:
https://bugs.eclipse.org/bugs/attachment.cgi?id=106032
http://www.steinerberg.com/EmbeddedComponents/System%20Search/com.nokia.search.system_2.0.0.201102171254.jar
I put either com.nokia.search.system or com.nokia.search.system_2.0.0.201102171254.jar in c:\eclipse-php\plugins. I also tried putting com.nokia.search.system.feature in c:\eclipse-php\features but it still didn't work because the folder is empty so I get this message in eclipse's error log:
!MESSAGE Unable to find feature.xml in directory: C:\eclipse-php\features\com.nokia.search.system-feature
I take directory search for granted in tools like TextWrangler and Xcode on the Mac and am flabbergasted that the Eclipse developers don't include arbitrary file search in their IDE.
Another possibility is to somehow add the C drive to Eclipse's workspace. I mainly need this to search directories like pear. I guess a free app might be an ok solution, if there's a way to tie it into Eclipse somehow, that would be helpful.
Thanks in advance for any help you can provide,
Zack
If I understnad your question, you are trying to search folders/files outside of the eclipse workspace. My advice would be to create a new folder through new -> wizard select it as a "linked" folder and point it to the folder in your file system that you want to include in the search.
Say you want your C drive included in search. Create new folder, click on advanced which opens more otpions and select link to alternate location (linked folder) and click browse and select your c:\ drive. This will create folder in your workspace that is a pointer to the c drive and will be included in search queries.
First off, Duncan, thanks for your answer. It is the best for the purposes described in the original question.
I see this thread is a bit old but I would like to give some useful suggestions:
Additional plugins only slow down Eclipse. It already has so many plug-ins that come with it. I try to keep mine as slim as possible (a lean version of STS) and use external tools for tasks I perform outside of core development, like version control - I removed all my Git and SVN plug-ins manually.
Linked folders work best because you narrow down the search. If you try to search the entire file system you are probably better off using your OS and its built-in utilities designed specifically for that. They are faster and support all sort of searches that you would otherwise not be able to execute from Eclipse.
I haven't tried this on 3.0.2 but I came across this question after trying to setup a new Eclipse and working out which plugin I had before that allowed me to do this.
Turns out you need RSE (Remote System Explorer) which gives you Remote Search and you can use a local connection to select a folder on your local machine.

Eclipse RCP product - is there anyway to update the PATH during launch

I am working on an eclipse RCP product on windows which internally uses some native binaries (dlls) located in a folder called "bin" which would be available as a part of the product.
I need to make sure that the folder "bin" is present in the PATH when the product.exe file is executed. Is there a clean way to make sure that the folder "bin" is added to PATH when the eclipse RCP product is launched?
I don't want to write any script or batch file that updates the PATH and then calls the product.exe. I also don't want to update the environment variable through the windows UI or command prompt.
I know that when we try to run my product from the eclipse IDE environment, there is an option in the run-configuration, wherein one can configure Environment variables on the Environment tab. I can append the "bin" folder to the PATH by creating a new environment variable called "Path" whose value is C:\EclipseRCPProduct\bin;${env_var:PATH}.
However - I would like to do the same when I run my product directly from the Product.exe which is generated. Does anyone have any idea regarding this?
Also - if anyone has any idea regarding the eclipse code which processes the information specified on the Environment tab of the run configuration, it would be great. I could try playing around with the code to see if I could get it to work when the product is launched from outside eclipse IDE - via the generated RCP product.exe
I don't think there's a way to define system environment variables within the launcher.
The following bug seems to request just that
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286463
In the above mentioned bug, a .bat is attached to achieve your goal.
That said, why do the native binaries have to be located in a bin folder?
I.e. why are they not included in a plugin/fragment?

How to have different file links to an Eclipse project (not importing it)?

I noticed when I import a file, the file is copied to the work space, but can I just create a file link in a Eclipse project? So when I modify the files in Eclipse, the files in the linked location is modified. In this way, I can version control the files using SVN. And I don't need to copy the modified files back to its dedicated directory when deployment.
The following is a more detailed description of my problem:
I have a cgi application located and runs in apache. The app runs with diff configuration files for different 'projects' which is more like showing different dataset with its corresponding configuration file. My task is to write the configurations files which will require some perl callback functions, css files and images. All these files have their own dedicated directories located in different places in the company server which i have not much control with.. So far, I just use command line to modify files and keeping old copies for version control. If I can do something like my above description, I will be able to have a central place to work on and do SVN. Or do you have a better idea how I should set up my work environment?
Thanks heaps in advance.
Yes you can,
File -> New File -> Advanced (at the bottom) -> Link to file in the file system
Manu
I have figured out a way to conveniently to version control files from different places and can deploy them to the correct directories after modified. It's ....... using..... the ANT build file... I just have all files imported to a single project and use an ANT build to distribute them back to their corresponding destination.
Use svn:external http://svnbook.red-bean.com/en/1.0/ch07s03.html
One drawback though, you have to update your other projects once you commit a shared files.

Sharing Eclipse directory on Dropbox between Windows and Mac OS X

This question was close to mine, but not quite.
I have a Windows desktop and a MacBook Pro. I'd like to be able to keep my Eclipse workspace in my Dropbox folder. The problem is that many project settings change between platforms: references to JREs, JDKs, and other libs.
Every discussion I've seen of this problem seems to suggest taking advantage of the source control system's ignore functionality, so that such-and-such file remains local-only and thus able to remain platform-specific. But when you're working with a real single shared folder, that class of solution doesn't apply.
Have you had luck working with a Java Eclipse project living in a single folder shared over the network, cross-platform?
I have my Eclipse workspace inside Dropbox with all my project folders within, but use the new-ish "Selective Sync" feature of Dropbox to make sure that the .metadata folder is not synced.
This means my Mac and Windows machines have their own .metadata folders but the project folders remain in sync.
Seems to be working so far...
Use source control with individual workspaces. By doing it this way you lose the capability of two developers making changes to the same file. You also run a higher risk of people stepping on each other. With Subversion (or others) source control is free and gives you traceability.
Perhaps the way to have less problems is just to share the source folder, neither workspace settings nor bin folder.
Just put your source folder in Dropbox.
Create the project on site1 and then:
Right click over the project, choose properties
--> Java Build path --> Source tab
--> Link source button
Then create a link to your source folder in Dropbox and assign it a name (e.g. src2)
Make the same for site2.
All your source files must be in your share source folder in Dropbox.
Of course you must configure on each site the settings like libraries and other stuff but this task is less frequently and perhaps desirable because you have two different environments.
For anyone else having trouble getting this to work, try File->Import->General->File System. Be sure to select Create links in workspace from the Advanced options. Seems like the cleaner solution and you can keep using your usual workspace.