how to change GWT compile output path in Eclipse 4.6 - gwt

I use eclipse 4.6 to compile my gwt project.
The output path is target/se-monitor-1.0-SHAPSHOT/.
I want to change the path to src/main/webapp.
I adopt change run configurations --> GWT compiler --->arguments---> working directory, but the result is src/main/webapp/war.
There is a war catalog.
How can I delete the war catalog?

I assume you're talking about GWT Eclipse plugin.
If so, then I do this by
editing the .launch configuration
going to the Arguments tab
manually entering extra argument -war <your_desired_location>
I don't know if Eclipse lets you edit this in any other way. It might, but I don't know.

Related

Creat JAR from .jardesc in eclipse

I have a question with respect to compiling java codes and building a jar file on Eclipse platform. I would like to know if the Create JAR option on eclipse from a .jardesc file will still create a JAR file inspite of errors in the compiled Java codes? If yes, how can i enable this option in my Ant build xml?
If you edit your .jardesc in Eclipse (Open With – JAR Export Wizard), you can modify the behavior regarding errors/warnings on page two of the wizard:
.
This apparently toggles the attributes exportErrors and exportWarnings, respectively, at XPath /jardesc/options in the .jardesc file.
As far as the behavior of a corresponding Ant build file is concerned, you should probably take a look at the failonerror parameter of the Javac Task.

GWT Eclipse wont compile classes into war/WEB-INF/classes

I use the GWT Version 2.5 , eclipse 3.7 and java 1.6.0_35
I am facing this problem since I manually deleted the classes in myProject/war/WEB-INF/classes . In eclipse everything looks fine, however when I compile with ant or gwt compile over eclipse it wont generate any new class in that particular folder. As consequence I receive a war file where the classes directory is empty. How can I fix it such that the classes are comming back to this folder?
Make sure the "Default Output Folder" in Project⇒Properties⇒Java Build Path points to the right place. Using built-in Ant, that's probably myProject/war/WEB-INF/classes.
Also, check "This Project has a WAR directory" in Project⇒Properties⇒Google⇒Web Application. For Ant, the path should be war.

No build.xml file found when running an eclipse project

I am very new to gwt and in fact I don t really understand it.
I have a web project that had already been developped. I just want to change the toolbar that requires gwt in a RichTextToolbar.java file. So I downloaded Eclipse and its gwt plugin.
In a precedent question, I had the answer that I should take thes only file RichTextToolbar from my php/html directory, put in the src folder of my eclipse web application project; then run it and finally taking back the compiled files from the war folder and put it in my php/html directory.
Now, the problem is that when I debug or run the files in eclipse, I am told to choose ant. And then I have a message that no build.xml file is found. Could anyone help?
Best,
Newben
If your intention is to compile the Java code in GWT to Javascript, then you can use 'Compile GWT Project' option under GWT menu in Eclipse.

NetBeans -- Is it possible to bypass the IDE-generated Ant build for an existing project?

I have a Java project with sub-projects that is currently built using NetBeans's IDE-generated Ant scripts. I am converting the entire project to a Maven build.
My Maven build works fine from the command line and loads perfectly in Eclipse. However, the only way I can get the project to load as a Maven project in NetBeans is to delete the Ant scripts, i.e. build.xml and the directory nbproject for each sub-project. It seems that as long as I have the old IDE-generated build files, NetBeans recognizes the project as a NetBeans Java project only, not as a Maven Java project, even though there is also a pom.xml file present.
Short of deleting the IDE-generated build files, is there any way to tell NetBeans to load the project as a Maven project?
I have been told that we want to keep the Ant build for a while during the transition to Maven.
Using NetBeans 6.9.1, Maven 2.2.
Any help would be appreciated.
Thanks
Well, the nb ant project metadata has precedence over occurence of pom.xml file (that's how maven projects are recognized and loaded). The whole precedence order hardwired in the IDE, you could only influence it be uninstalling the j2se ant project type for example.
So, yes. You need to get rid of the ant project metadata before you can open the project as maven project. Depending on how and when you delete the metadata, you might need to restart the IDE as well to get the new stuff loaded.
Have you seen http://wiki.netbeans.org/MavenBestPractices? It indicates that you must install the NetBeans maven plugin first. Perhaps that's why your Maven projects aren't recognized.
I must note that I'm not a NetBeans user anymore!
Here is what I ended up doing:
I wrote an Ant script (ironic, huh?) that, for every subproject of my project, renames the file nbproject/project.xml if it exists to nbproject/nb_project_disabled.xml. If nbproject/nb_project_disabled.xml exists instead, the script renames it back to nbproject/project.xml. In this way, the script toggles the opening of the project as a NetBeans Ant build or as a Maven build.
It would be nice if NetBeans, you know, had a setting to open both kinds of projects. Currently (6.9.1), there is just the "Open Project" command. In Eclipse, there is the command "Import Existing Maven Projects" vs. "Import Existing Project Into Workspace" (i.e. native Eclipse format).

How can I reference ANT HOME from the libraries in the properties of a project when using eclipse?

In our code base we have a dependency on the ant version used in eclipse.
In the the ant.jar has been set up as a library which the project uses
This is a pain when moving versions of eclipse as the Ant plugin folder name changes (although I see it is now just called Ant1.7)
Is there a way to access eclipses reference to ANT Home which appears in the workspace preferences so that I don't have to explicitly set a variable that has the hard coded path to the ant plugins folder
Your project should not have a dependency on eclipse's version of Ant in the first place, you should keep your own version so as to decouple your project from eclipse. What if a developer or yourself decides to use intelliJ?
Although i don't know what the nature of your project is, i would have thought all dependencies should be added to your projects lib directory or something similar.
One possible suggestion would be to :
transform your project into a plugin project (properties on your project / PDE tools / convert Project to Plug-in Projects...) and
add to its dependencies the 'ant' required plugin.
That would be easier to manage when you change the version of eclipse.
Have you considered installing Ant separately, creating an environment variable, and then referencing the location via the ANT_HOME environment variable within your Ant build.xml?
From within your eclipse, on the package explorer view, right click on the specific project and build path.
Move into the Libraries tab and select the "Add Variable..." button. From here you'll see that is where the JDK system libraries path, maven(if you're using it, tomcat, eetc...) If ANT_HOME doesn't appear, you can add it by clicking the Configure Variables... button. From this moment, the ANT_HOME path will be considered in the build path of the project.
Hope it helps.
Carlos
Your ant home is available in the property ${ant.home}
E.g:
<echo> ${ant.home} </echo>
Gives the following on my machine:
[echo] D:\java\eclipse_3.4_jee\plugins\org.apache.ant_1.7.0.v200803061910