delete eclipse project using ant - java

do somebody know how to delete eclipse project using ant?
I'm using eclipse in silent mode, to run ant build scripts and before build I'd like to delete 2 project which are generated automatically by eclipse. Is there any option? (Something like <eclipse.deleteProject />)
thanks in advance

There's nothing eclipse exposes by default to ant, AFAICT. I'd use ant to delete the folder (as suggested) and then use the eclipse.refreshLocal task on the workspace root. For what eclipse does expose, see Ant tasks provided by the platform.

Related

What exactly IntelliJ is doing when compiling project using Gradle?

IntelliJ IDEA 2016.3 add the ability to delegate build/run to Gradle.
It's clear that when the delegate option is on Gradle is doing everything.
My question is what exactly IntelliJ is doing when this option is off?
I'm asking this because I have custom code inside my Gradle files and it does not seems like this code is executed when building in IntelliJ. When I run gradlew build everything works just fine.
IntelliJ has its own build system, called JPS, which uses the IntelliJ IDEA project and .iml files as the project model. When you're using IntelliJ IDEA's default build system to build the project, it does not execute any code in Maven or Gradle files; it uses its own logic, which can only be extended by writing plugins to JPS.

Pre-Debug script in Eclipse

I use Eclipse to code my project and in order to debug\run it I have a "Maven Build" configuration with a goal.
My question is: How can I run a script file that deletes my log files before the debug starts?
Thank you.
You can't do it automatically buy you can use a script or an ant file linked from your external tools menu. So before debugging you would need to run that external tool.
Maybe there is another way. You can delete it from a maven goal if you launch the app with maven. I don't know exactly how. You can launch with maven with the exec plugin. Codehouse site is down (terminated) so I link this tutorial:
http://www.vineetmanohar.com/2009/11/3-ways-to-run-java-main-from-maven/
EDIT:
You can delete the files using Apache Maven Clean Plugin:
http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html
You need to make both steps (delete logs and run with both plugins) execute when you build with the same goal and in the right order. I don't know how to do it but I am quite sure it is possible.

Converting an Eclipse Java project into an SVN project?

So I am trying to do something slightly unusual.
I checked out a project using Tortoise SVN, and then I imported that project into Eclipse as a Java project, and I can build the project fine.
But I would much rather use Eclipse's Subversion plugin than Tortoise SVN to check in files, update, compare diff's etc.
So is there any way I hook that Java project back into SVN in Eclipse, and then be able to check in files etc through Eclipse.
Note that checking out the project again using Eclipse is not an option for a few different reasons.
Thanks.
Right click on the Project and select 'Team > Share Project...' to set up SVN on the project.

Eclipse m2eclipse clean, build projects, build automatically commands, what are they?

What is the command that m2eclipse runs when you
highlight a project -> Menu Project -> Clean -> Select anything -> Ok ?
It then goes on to "Building Workspace".
What is the command that allows it to do so?
The reason I am asking is that I am trying to do this from outside Eclipse, from the command line. I am trying to automate all maven stuff in a Groovy script. I am on Windows xp.
EDIT:
Also, the command update maven dependencies would be nice to have as well.
Thanks!
Maven-invocations are put in the Run and Debug menus. Just building the workspace does not run maven - it just does all the work Eclipse needs to do to know your files.
For your purposes these will suffice for the command line build:
cd /to/where/pom.xml/is
mvn clean
mvn install
No commands are directly run. Instead, the m2e plugin uses the configuration in the pom to create equivalent configurations in eclipse.
For example, if you change the source directories it will update the eclipse source directories for the java builder. If you change the target directories for the source compilation, it'll ensure that when you do a Project -> Clean, the plugin knows which directories to clean.
If you are trying to do this though a scripting language, I would recommend just running commands on the command line. The alternative would be to add the maven libraries to the classpath and to use them.

How do I view Ant scripts that eclipse uses?

I am having a bit of trouble building my project with Ant. I wanted to take a look at the Ant scripts that eclipse uses to build my project. How can I do this?
I don't think eclipse uses ant scripts to build your project by default. However, eclipse can generate ant scripts for you. This can be done by right click project > export > General > Ant buildfiles. Make sure you uncheck the 'use eclipse compiler' if you want the build file to be usable from outside of eclipse.
No ant scripts are used building in the workspace, however, exporting your projects does use ant scripts. You can generate such scripts by right click on the MANIFEST.MF or feature.xml and PDE Tools -> Create Ant Build File.
The exact contents of the generated ant scripts will depend on the options selected for export, so there may be some differences.
Select Project » Properties » Builders to see what runs when Eclipse builds your project.

Categories

Resources