I have some plugin UI tests running using SWTBot.
As a result of this i had to add some libraries for SWTBot and some other things to the dependencies and classpath of the plugin.xml. But i dont want to have these in the software delivery.
Is there a way to set up a second plugin.xml just for the tests or any other solution to separate this?
Thanks!
Create a separate plugin to hold your tests and SWTBot dependencies.
Related
In Maven you can do mvn eclipse:eclipse to run the eclipse goal of the maven-eclipse-plugin. Is there a similar way to do this in Gradle? I'd like to run the plugin for my IDE of choice but I want my build script to remain "IDE-agnostic".
I don't want apply plugin 'eclipse' in my build.gradle file but want it to generate the Eclipse files it needs. This way users of IntelliJ won't need to swap it.
Rather than rely on the build tool to configure your IDE (who ever thought that was a good idea is beyond me), set up the IDE to understand and integrate with the build tool. Eclipse is specifically designed to share configuration in such a way that each person who checks out a project from source control gets the project configured correctly with a minimum of manual intervention. Gradle support is much newer and somewhat less mature than Ant or Maven, but it works. See the Buildship project, which allows you to point Eclipse at your existing Gradle-based project and import it as a properly configured Eclipse project, no need for hacks like mvn eclipse:eclipse (which is now deprecated/retired, by the way)
I'm learning Maven, and I have a sample project with a simple pom.
I want too add the surefire plugin so I may run junit tests.
I'm assuming that I can somehow add the plugin using Eclipse, or do I need to use the command line?
It seems the answer provided by #Ajay George is best, but if you're missing the pretty JUnit GUI with the red and green bars, refer to this comment by #thSoft:
You can view Surefire's test reports in Eclipse's JUnit view if you
open the XML files in target/surefire-reports.
Install m2eclipse which contains the surefire plugin.
The screenshot give below contains the "Run As" -> "Maven Test" option which will invoke the surefire plugin.
Is there a way to integrate in an Eclipse RCP project the JUnit Window? I am planning on creating a test script runner and I want JUnit window to be in my application.
Sure, but not as you expect it. The JUnit view is contributed by org.eclipse.jdt.junit (which you can see by hitting Shift-Alt-F1 with that view being active). So you need to include that as a dependency in your plugin (or in your product definition, if you have one).
The bad news: I have not checked the dependencies for that plugin, and those dependencies will probably take most of the JDT into your application also, which is probably not desired.
In Eclipse it is possible to configure builders for a project. I am using m2e and Eclipse indigo for a dynamic web project. I am trying to figure out exactly what happens when I invoke Build for the project from eclipse and so be able to understand the difference between this and a just doing a maven build from the command line. I go to project / builders and see there are five builders: JavaScript Validator, Java Builder, Faceted Project Validation Builder, Maven Prokect Builer and Validation. It would be interesting to see what goals the Maven Project Builder will do but I can't see this from this screen. Edit is disabled. I try Project Properties / Maven and there is nothing to do with Goals there. Even though this http://maven.40175.n5.nabble.com/Preventing-Maven-project-builder-from-being-run-td137622.html suggests there should be.
I am wondering is there any way to see and configure what goals Eclipse will call?
Many thanks.
Strange as it sounds, m2e does not really invoke Maven to do the build.
Its job is to parse POM file and delegate the job of doing everything that it finds there to Eclipse.
It does so by mapping maven plugins to special m2e Eclipse plugins.
Sometimes, when no mapping exists you get a warning and you have a choice of either disabling this part of your build or running the maven plugin in I guess default wrapper provided by m2e. In either case the result is not as good as when a maven-to-eclipse plugin mapping exists
I'd be interested to find out about any automated processes that people have for ensuring that the project classpaths for the ant and eclipse configurations are in synch. In my case, I want the classpath defined in the ant build file to be the master configuration, since its used for our production builds. As part of the build i'd like to add an ant target that will verify that the eclipse classpath is up to date, or at least indicate differences between the two classpaths.
I'm aware of ant4eclipse but its focus is in the opposite direction, ensuring that the eclipse classpath is master and that the ant build reuses the eclipse path. I like the idea behind AntAndEclipse but am wondering are their ant other tools in this space that i'm not aware of.
You solution at a previous company was to have ant invoke Eclipse to do the compiles as described here:
http://www.eclipse.org/articles/Article-PDE-Automation/automation.html
I'm not aware of any ant tools which can do this but I've switched from ant to Maven a few years ago and never looked back. You can use the "Maven integration for Eclipse" to make Eclipse use the Maven classpath.
As of today, I'm not 100% happy with the Eclipse plugin, though. It's a bit slow and due to the different philosophy of Eclipse and Maven, some operations behave strange. For example, Eclipse doesn't differentiate between a "production" and "test" classpath, so you can get compile errors in Maven when everything looks great in Eclipse.
My solution was to use the plugin to keep the classpath in sync and compile from the commandline.
there is an ant task to do xml transformations, we used that task to create the classpath in our build file. It was a little trick to get the XSL right but once it worked it was great
Did you evaluate Apache IVY? Currently I am building a Continuous Integration environment at our place and we use IVY to handle our dependencies. There is a eclipse plugin that takes the dependency configuration of eclipse and uses it as eclipse classpath.
Currently this solution looks quite promising.
My team wrote an Eclipse plug-in to add a new type of library to the Java Build Path->Add Library option in the project settings. This custom library type allowed both Eclipse and ANT to reference the same canonical list of dependencies.
Nowadays, I'd probably look at IVY for doing the same thing if I was locked into using ANT, rather than writing my own.
You need Ant2Eclipse.