- This topic has 3 replies, 2 voices, and was last updated 17 years, 5 months ago by Riyad Kalla.
-
AuthorPosts
-
gjandersMemberHi MyEclipse,
I commonly have an issue that when attempting to checkout a project from CVS, the project appears as a standard java project.
This is fine but I cannot add new libraries to it to make it a J2EE project because it is already a J2EE project, its just that MyEclipse doesn’t know about it.
The only way I’ve found around this is to hack the .project files and then to refresh the project.
Can we please get a button to make an existing project a J2EE project without adding new libraries or configuration files?
Regards,
Gareth
Riyad KallaMemberGareth,
When you say “hack the .project file”, how are you hacking it?You might be confusing a MyEclipse project type with a WTP (or other plugin) project type. MyEclipse requires the existence of a web nature in the .project file as well as a .mymetadata file in the root of the project. If those things aren’t there, MyEclipse won’t know that your project is a web project.
Also adding Web Capabilities to the project merely adds the Library Set that you can easily remove if you don’t need it (in addition to creating the .mymetadata file)
gjandersMemberWhat I did was change the .project file’s buildSpec from something like:
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>temp</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription
To:
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>MOSII J2EE</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature> <nature>com.genuitec.eclipse.j2eedt.core.webnature</nature> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription>
Now from the first one if I go to the “deploy” section in Eclipse, then I can’t deploy.
If I change my .project file to be like the above, and refresh the project I can suddenly deploy the project.Thats the difference I am referring to.
Regards,
Gareth
Riyad KallaMemberGareth,
MyEclipse only supports deploying web projects…. you can turn a Java Project into a web project by right-clicking on it and selecting MyEclipse > Add Web Capabilities. In addition to adding the necessary Web natures, it also creates the top level .mymetadata file which contains your WebRoot and other important dirs.Directly hacking your .project file isn’t going to make MyEclipse happy 🙁
-
AuthorPosts