Today I faced problems in starting eclipse (reinstall etc. did not work). I had to use a vanilla eclipse and with luck it was working.
With that I experienced the problem of an IDE that is not working. That can be a mess if you need a quick bugfix for a hot system.
Is there a tool that takes an eclipse-project and converts it into a makefile for a more basic tool (like ant, maven, gradle, ...) that work from the commandline?
Sure I can make it by hand but because it should be only a safety I would prefere the automatic way and keep the development-work in the IDE.
EDIT:
Or maybe: Is there an build-command that works on the commandline without starting the IDE?
Thanks!
Running "gradle init" from the command line will attempt to create a build.gradle for your project. If your project layout is "conventional" it might do a good job. If it finds anomalies it tends to give up. Constructing a simple Gradle build script for a simple project takes a few minutes once you get used to it. Searching the web with intelligent queries will tend to find lots of examples.
Adding the "Gradle Nature" in Eclipse is simple if the project is buildable from the command line with Gradle.
You can use m2e eclipse plugin to convert your existing projects to maven projects. But you have to do it before hand(while your eclipse is still working)
https://crunchify.com/how-to-convert-existing-java-project-to-maven-in-eclipse/
Related
I am new to the whole Gradle thing and I find amazing already. I am experimenting with the tutorials they offer on their website on how to setup a project, build etc etc. My question is the following.
I have successfully set up my first project, build it and run it. After this Eclipse shows an error about not being able to find library imports (the ones resolved automatically by Gradle). How am I supposed to fix this?
Also are there any good addons for Eclipse that offer Gradle commands (I am currently building the project by running the command on Cygwin) as well as syntax highlighting for build file?
I'd like to make Gradle use Eclipse project dependencies. Unlike this question, I don't want to do any export as I don't want to hunt down problems due to forgetting to re-export after a change. And unlike this question, I don't want to integrate Gradle into Eclipse at all, as I'm satisfied with how my Eclipse works (it's much faster than a Gradle build) and I'm also afraid that my Eclipse 3.7.2 may be too old for such games.
Ideally, I'd like something like
dependencies {
compile allFilesFromEclipse()
}
Actually, getting the JARs would suffice.
What I've tried: Just some light googling. I could imagine parsing the .classpath file myself, but it's not done in 5 minutes, so I'm asking if there's an existing solution.
I am afraid you won't find much help. It is not obvious what problem you want to solve here. Most developers prefer to base their build on a build tools rather than expect that they will replicated an IDE setup everywhere.
As for Eclipse 3.7.2: I am not sure why you want to stick with that but gradle eclipse generates files that work with this version.
I am very new to Jenkins. I have gone throught the tutorial of jenkins and I want to create a build job for simple java project. I know how to create a freestylebuild but I dont see any connection between the build and the project. Whats happening exactly. I have my project in eclipse and how can i create a build to the project. How do i know that it is the exact build for this project.
Can anyone please help me.
the best thing to do would be to move your build to some standard command line tool, like ant, maven, ivy, gradle etc and then you can reuse the same build from your IDE and on jenkins. note that this doesnt mean giving up using your IDE - many IDEs can import these types of projects directly and give you all the benefits youre used to in an IDE. it simply means that you get a build thats "portable" and not tied down to the specific IDE your using.
personally i think maven is best supported in this regard, but its mostly a matter of personal preference.
I have looked for an answer for this nearly every where that I can think of, but there doesn't seem to be any way to actually SEE what Eclipse "runs" to compile the projects (as it does need the JDK installed and visible to actually build). I ask because I imported a few jars into my project, and even though I've looked through all the javac documentation, I can't seem to figure out how to mimic it quite like Eclipse does. I really, really need to be able to compile on the command line in this case - Eclipse or any other IDE just isn't what is needed.
I started to look through the Eclipse source, and although this sounds lazy, I just became overwhelmed and figured I would ask here first, hoping someone else had the same question at one point.
Eclipse JDT does not require the JDK and does not use javac - it uses it's own compiler.
You can see the classpath by reading your project .classpath file. The various builders that are used to perform build operations (Java, or whatever the project builds) are listed in the .project file. (These are also listed in the project settings.)
It is possible to invoke Eclipse to build your project in headless mode, or write Ant scripts that can be executed both with the JDK and within Eclipse, or install Maven support for internal and external building. It is also possible to configure the project builders to rely only on external tools.
Look at these two articles.
http://www.eclipse.org/articles/Article-Builders/builders.html
http://www.eclipsepluginsite.com/builders-natures-markers.html
Look at your .classpath file and start building an ANT build.xml. You need to do this to be able to have consistent builds on a build machine anyways. It is unlikely that a build server would have eclipse installed on it anyways.
Maven is also another tool that is used for builds. In our shop we use Ant.
Have a look at ant4eclipse - this project allows for generating the appropriate ant data structures for invoking <javac> from the .classpath files and a projectSet.psf file.
By using this we can use Eclipse "natively" and bend ant to conform to Eclipse. The usual approach is the other way around.
I am trying to set up a headless build for a big eclipse feature, containing other features and plugins.
As some needed plugins are generated using GMF and EMF, the build workflow must be something like this:
SVN Check-out
Invoke Generation
Run Tests
Build all
Publish update-site
Over the last couple of weeks, i played around with PDE Headless Build and Buckminster. Anyhow i still got problems with both and can't decide on which i should spent my effort.
So what would you prefer? What experience you made? Anybody out there who needed to set up a similiar workflow before?
Thank you for all answers :)
Buckminster sits on top of PDE build, so there's no getting away from PDE build in the near future.
You could try another free plug-in that sits on top of PDE build: Plugin Builder as it does the generation of the ANT XML and the nasty map file that PDE build requires. It even has the extension for SVN-based map files as opposed to CSV. I successfully setup Plugin Builder running from Hudson for my team's build needs.
Another alternative is to look at Tycho (Tycho is the OSGi/Eclipse related bit of the next version of Maven). It is a work-in-progress and it does use PDE build under the covers. I tried and failed with some experiments with Tycho, but they do have a recent new alpha/beta build, so you may have more success (and there are other people who are successfully using it).
The only problem I've had with PDE build is the map file for checking out. I wrote my own ant task to do the checkout for me using SVN, based on conventions on where the plugins are located, instead of having to explicitly state in the map file all the file paths. Worked wonders and now I can just add plugins to my svn repository and refer to them in the feature.xml and it just works.
We're building using buckminster(check out, compiling, testing and byte obfuscation). I haven't tried a PDE-script, but if you have a complicated setup with a lot of dependencies on other libraries/projects I think buckminster will scale better.
I've recently started to move our entire Eclipse build-infrastructure from PDE build to Buckminster, and I have mostly good things to say about Buckminster. While builds based on the PDE build scripts/templates tend to be very brittle and requires a large amount of surrounding infrastructure to work, Buckminster feels quite robust and does not require any significant additional scripting around it. Buckminster does take a while to get into, but thanks to the excellent documentation and the very helpful newsgroup, I was able to get a full build to work in a few days.
Buckminster is what Eclipse should've had from the very beginning to handle headless builds.