Eclipse is not creating structure for Enterprise Application Projects - eclipse

When creating a New Enterprise Application Project, instead of creating the usual tree with:
+Deployment Descriptor
+JAX-WS WebServices
+ejbModule
+JRE System Library
+JBoss v5.1
+EAR Libraries
+JavaScript Resources
+build
Eclipse is creating only a very simple structure. Like This:
+JavaScript Resources
Only the .settings folder and .project file are being created in the project's folder. No source, etc.
What's going on with this?
Thanks

It sounds more like you're listing the contents of a View rather than what's actually in your project. There isn't actually a "JavaScript Resources" folder, it's a root node under which the project's known types and globals are browsable. Have you checked the Project Explorer view (Window->Show View)?

Related

When adding resources to a Tomcat server in Eclipse, what can be a resource?

When I bring up the "Add and Remove" resource dialog to add things like .war files (I think war is an example), I would like to know what sort of things constitute "resources" and how Eclipse identifies them as such. I am working on a new project that has a fairly complex Maven build and it is not clear to me what exactly I am adding to Tomcat. Could a directory be a resource? A pom file?
I should mention that I see a SNAPSHOT file (actually, the thing named this seems to be a Windows folder which does not hold jars) as a resource that can be added but the build does not seem to be producing a war or jar file which is named in this way. What does get added if I choose to add this resource seems to be composed of a bunch of jars or wars.
Perhaps you didn't create your project as "Dynamic Web Project", so Eclipse doesn't recognize it like a web project. Create new "Dynamic Web Project" or go to Properties -> Projects Facets and check Dynamic Web Module
It looks like entities other than jars can be added to a server.

Multi module maven project is not showing in package structure but as folder structure in eclipse

I have successfully imported a multi module maven project from GitHub into my eclipse and able to build it successfully.
But the problem is project is being shown in folder structure but not as package structure which is making my day tedious.
Could anybody else faced this issue? Please do suggest your ideas.
Check out if the Project view in hierarchical mode would be a better fit for your need.
See Eclipse 4.5M5:
The Project Explorer now provides the ability to view the projects in a hierarchical (a.k.a. nested) form.
For modular projects, this allows to have your Project Explorer mapping more closely the organization of your modules as they are on the file system.
This hierarchical view of projects often makes easier to navigate modular projects.
Hierarchical view of projects can be triggered from the Project Explorer view menu, under the Projects Presentation item.
Then it makes the folders that are at the same location as a project replaced by the project, and the projects that are nested under other projects will not be shown as root elements.
In the folder where you have downloaded the project from git, you will see a .project file. You need to provide buildspec and natures information in that xml file.
In my case the .project xml file looks like this -
Now, make sure that you have provided the buildspec and natures information as shown in example above.
Once you have made the changes to .project xml file -
Right Click the Project >> Refresh
Right Click the Project >> Maven >> Update Project
You will see that the project (source) folder structure is represented in desired format.

Eclipse buildpath automatically taking all JARs of a linked directory

This issue is a variation on the one described here: Eclipse buildpath automatically taking all JARs of a internal directory
But instead of any local folder, I'd rather have a linked folder from another project be picked up automatically in the buildpath.
Basically, I have a main project in my workspace that holds directories lib, ext-lib that contain multiple jar files each. These jar files may be upgraded/removed or new ones added every few days.
I also have many other projects in the workspace that relay on the exact same (up-to-date) jars from my main project.
My goal is that as I modify the jars in these two folders in my main project, to have them as linked folders in all other projects and have those linked projects dynamically picked up as part of the buildpath of all those projects.
Any suggestion on how to do that in eclipse would be highly appreciated.
Unfortunately, the "dynamic directory" plugins people mention can not work with "linked" folders :(
Sincerely,
Guy
I would suggest creating a USER LIBRARY in eclipse and then using that in all of your eclipse projects.
Try going into preferences Java -> Build Path -> User Libraries and creating a new user library with all your jars. Then use this everywhere you need these jars.
See this page for more details.
Also, this page explains creating a user library in a bit more detail. There is also a use-case there which seems a bit more aligned to what you had in mind:
6.2.1. Linked Library Project
A useful hybrid strategy is to configure a user library that is also available as a linked folder in your Eclipse workspace. Follow these steps:
1.
Create a simple project in your workspace. Unlike Java projects, a simple project has no Java build path configuration in its properties. Use the command File > New > Project > Simple Project.
2.
Uncheck the option to use a default project location within the workspace folder and enter the path for your \eclipse-contrib\libraries folder (see Figure 6-8).

Accessing Linked Resources in Eclipse

I am currently working on an effort which makes use of Windriver's Workbench tool, which I understand is built on top of Eclipse.
Our source control tool is ClearCase and we are working primarily out of snapshot views located on the workstations of individual developers. As a result the absolute path for each developer's view is different. As deeply nested relative paths can be somewhat cumbersome (e.g. ../../../../../Some_Package/src/) we are using a Linked Resource PROGRAM_ROOT_PATH which identifies the particular view directory for a given developer.
This is working relatively well for for referencing header and library directories in the build properties, but we are trying to reference that Linked Resource from our build scripts in order to do build post processing such as copying the compiled program to a release area.
Accessing the Linked Resource as though it were an environmental variable appears to be the wrong thing to do as $(SOURCE_ROOT_PATH) provides an empty string. Is there a way to access this information from Eclipse / Workbench from a makefile?
Look inside the .classpath and .project files in the root of your workspace project - I believe the linked resource should be defined in one or the other of those (probably .classpath). From your script (you don't mention if it is Ant, Maven, Gradle, etc.) you should be able to find a way to get that value out of the .classpath (through some plugin or custom code).
We use Eclipse, ClearCase, and Ant. The easiest way I have found to share projects is to include the .project, .classpath, and build.xml files in the top level of the project in ClearCase. Then when you create your view, mount it in your Eclipse workspace, and do a File -> Import, then choose Existing Project from the popup. Browse to the top-level of the project in the view and import it.
The paths in the build.xml and .classpath are relative from that point down, so it doesn't matter what the absolute path is up to the project. For example, your build will define your source directory as something like ./src/java, test directory as ./test/java, etc. Whether your absolute path is c:\workspace\project or /home/someuser/project or whatever doesn't matter to your build script.

Should I put nbproject directory under source control in NetBeans

I'm using NetBeans to develop J2EE web service.
NetBeans create a directory called nbproject inside my project directory.
I'm wondering if I should put this directory under source control. I think it is required to build the project without NetBeans.
This is usually not required. Think of it this way: If I was to check out your project but happened to be using a different IDE, I would not require your nbproject directory. In other words: This directory is machine specific, not project specific. Hope this helps.
The nbProject folder contains all the netbeans metadata about your project. When you go Project -> properties all the settings (and others) that you find there are stored in the nbProjects folder.
EDIT:
This has been answered in another question, and the answer there is more complete and accurate
In short you should include nbproject, but not nbproject/private
If you are building your project with Maven or Gradle you should definitely exclude the folder from the VCS.