I use ANT for all my builds and I also use eclipse as my IDE and I would like to be able to use the latest version of ANT in my eclipse, frequently the ANT that ships with eclipse is a point release behind. so my questions are.
Is there an easy way to get the eclipse ant plug-in to use the latest version of ANT?
Is there any easy way to add extra custom ant libraries to the built in eclipse ANT plug in, as I would like to be able to add things like the subversion task to my ant build and have it accessible from within eclipse.
Download and unpack the latest ant build anywhere on your hard disk, then run Eclipse, and go to
Window > Preferences > Ant > Runtime
and click on the button called
Ant Home
Browse to the ant folder that you just unpacked, and choose that folder. Now Eclipse will use this version of ant instead of the built-in ant. I use this way, and actually prefer it, because now I have the same ant version in command line and in Eclipse
In the same window you can add any other jars with 3rd party ant tasks, and they will be used by ant (just 'add jars'/'add external jars')
While not easy, by my standards at least, this is the way to update the ant plugin. At least for RAD 8.5, I'm sure eclipse is similar.
Go to Help -> About RAD -> Intallation details -> Plugins ... locate the org.apache.ant plugin version you are using. Note the Provider ... in this case for me it was Eclipse Orbit.
Next you need the repository URL for Orbit, googling got me this page.
http://wiki.eclipse.org/Orbit/FAQ
Which describes how to locate the repository.
Find the Orbit build drop that you need here:
http://download.eclipse.org/tools/orbit/downloads/
Add 'repository' to the URL of the drop. For example, for the drop in
http://download.eclipse.org/tools/orbit/downloads/drops/S20101204061544/
the URL that you would use is:
http://download.eclipse.org/tools/orbit/downloads/drops/S20101204061544/repository/
I personally went with
http://download.eclipse.org/tools/orbit/downloads/drops/R20130827064939/repository
Next, if you are behind a proxy, make sure that your proxy config is correct and the IDE can connect to the internet.
Then go to Help -> Install New Software
Next to the Work With dropdown hit the Add button and enter the repository information.
Select the apache bundle from the list and complete the steps of the wizard to perform the update.
Now that the repository is added to the list, for future updates you can use the Help -> Check for Updates menu item.
Good Luck, took me a day to figure that out and work through it.
Related
I added JDK and Ant to Enviroment System variables but that doesn't stop a simple Ant build in IntelliJ from breaking. I have set the system path variable to accept both Ant's directory and the JDK enviroment. I have created JAVA_HOME and Java is still functioning in the cmd.
There isn't any code in the project. There is just this build that generates this default code.
I haven't altered anything once I started the build and if I go into Project Structure -> Project Settings, I have the Project SDK set to 1.8.
What is going on here?
**EDIT: I managed to remove a lot of the errors by toggling a box to Generate the Ant Build to Use current IDEA instane for idea.home property. **
It looks like many properties from test3.xml are not available/defined in module_test3.xml. Did you already try to do a "Generate single-file ant build" (the second radio button in the "Generate Ant Build" dialog)? This could be a way to avoid the problem of Ant properties from one build file not being available in another build file.
Are you very attached to Ant for building your projects? You could give Gradle and/or Maven a try, to see if these tools work better for you.
If you are doing Android development, you could also check out Android Studio. If you are using IntelliJ IDEA, I would definitively consider upgrading to version 15; the community edition is free and version 10.5 is around four years old now.
I have a repository in which I have a simple ant project (only the src directory and the build.xml file). I did a checkout of this project in a local copy. Then I opened Eclipse, created a "Java Project from existing Ant build file" and it worked fine. I can build, clean, run, generate javadocs, etc. However, my problem is that the source files in the packages, as well as the project itself, doesn't appear to be under version control in Eclipse. I can work with it fine from Cygwin, but not from the GUI.
The odd thing is that I have several regular Java projects, on the same repository which are synced fine by Eclipse, so it's not a version issue.
When I created the projects that work, I had to go to Team->Share Project... and Eclipse told me that they were already under version control and updated its configuration. However, in this current case, this isn't working. Any suggestion please?
EDIT:
I'm using svn 1.8.
UPDATE: I tried creating a regular Java project, and this time the version control looks fine, so it appears it's an issue related only to Java Project from Existing Ant build file.
The problem is that Eclipse doesn't know your project is using Subversion as a version control tool. You did a checkout outside of Eclipse, then you set up Eclipse as if this was a non-version controlled project.
To get Eclipse to recognize the project as under Subversion, you need to let Eclipse know. This means you should have said "File->New->Project, and select SVN->Checkout Project from SVN in the new project wizard. Then, Eclipse would have checked the project out in Subversion for you, and Eclipse would understand this project is in Subversion.
Unfortunately, I am not quite familiar enough with Eclipse to know how to tell Eclipse that the current project is really under version control. The best I could come up with was:
Right-click on the project and select Team->Share
Say this is a Subversion project you want to share.
Select the Repository to use
Select the folder where you want this project, and select the current folder.
You get the following warning:
Warning: The specified folder already exists in the repository. If you continue, that folder will be checked out to the existing location. Do you want to continue?
Your project will now be "checked out" over your current project. Everything should be okay because the files you have either match what is in Subversion or are modified versions of what is in Subversion.
You will be then asked to use the Synchronized view. Check "Yes", and then switch back to the Java view. Eclipse will now know your project is under Subversion and everything should work fine.
Note the use of Shoulds and Coulds. This is my way of saying that the advise given is done on an "as is" basis and I am not responsible for any damage done by following this advice, so please don't sue me.
It's basically your standard open source license.
I have an existing project in Eclipse (let's call it "NotPlayProj") which has a lot of java code still under development. I made a new eclipse project using play 2.1.0 (let's call it "PlayProj"). My goal is to use code from NotPlayProj in PlayProj and have both Eclipse and the Play compiler notice changes in either project.
If I go into the properties for PlayProj and add NotPlayProj via the Project tab, then method completion and inclusion works within eclipse, but the Play compile doesn't see the result. I've looked at Play modules and those don't seem to do what I want.
Is there any way to do this, ideally without modifying the NotPlayProj?
Edit ---
I've looked at http://www.playframework.com/documentation/2.0/SBTDependencies which shows how to export a jar from NotPlayProj into the PlayProj/lib directory, but this requires a manual export for each time NotPlayProject changes. I suspect that the Managed dependency section is supposed to cover this, but I've never used SBT before and am therefore probably missing something basic.
What you need is continuous integration.
Have a look at Jenkins: http://jenkins-ci.org/
You should setup a Continuous integration server and customize the builds you need.
Example:
You have your PlayProj running in some server, it needs to be able to use some of the latest classes from the other project called NoPlayProj.
Rebuild is a must, things such as downtime zero are difficult to achieve(At least I don't think this is what you are asking for either).
The steps you need to automate with Jenkins are:
1 - Build and deploy the latest version of NoPlayProj which is located in some repositorium
2 - Build and deploy the latest version of PlayProj which is located in some repositorium and also is contains your last commit where you updated the dependency that exist with NoPlayProj
A not very complex build and deployment instructions can be configured in Jenkins. This should speed you up a bit.
Also another suggestion would be to mavenize both projects if possible, this will help you manage the dependencies easier.
Just to clarify one thing, you said: My goal is to use code from NotPlayProj in PlayProj and have both Eclipse and the Play compiler notice changes in either project.
Well the order in which you execute the builds will be dependent in what you want to do as long as you update the dependency before you commit the code.
One last thing, if you don't want to deploy you don't have to do so you can create the Jenkins jobs, in such ways that you only build. With Jenkins you can do a lot of stuff, also you could execute some help scripts of your own that can provide you additional functionality.
I hope this was useful.
To let Eclipse see changes in NotPlayProj when working with PlayProj, it's enough to change configuration of PlayProj. Properties-> Java build path -> Projects -> Add NotPlayProj as dependency.
There is no straightforward way to let Play compiler handle dependencies, until you package it as jar. Consider configuration of simple ant task (External tools configuration -> Ant build ), which will copy your jar file. Task can be triggered by pressing the key or button.
With managed dependencies, every time you made change in NotPlayProj, you have to manually rebuild it. To let Ivy/Maven put dependency in your local repository. After that Play will take latest snapshot from your local repository.
Both approaches requires some efforts. Maybe you can take a look at Python scripts, which run Play, maybe it's enough to extend classpath with NotPlayProj when executing play start
Though I've never used the play framework, I would think that there is a format that both the play framework and eclipse understand and that is Maven. Look at http://www.playframework.com/modules/maven-head/home
In Eclipse 4.2, is there a way to display path or project name information for an Ant build file that is included in the Ant View?
In my workspace, I currently have two versions of my project checked out, one from our myproject/trunk, and another from myproject/branches/feature
From each branch, I've dragged the appropriate build.xml from the project into the Ant View. However, since both the trunk and the feature branch have the same Project Name and same targets, its impossible to tell the difference between the two in the Ant View. Is there a way to either a) Show the associated project name/path for the build.xml or b) rename the display without editing the build.xml directly?
I know that I could manually update the Project Name for every branch/tag in my repository to use a custom name, but this seems like a hack more than a solution. Is there a better way?
Below is a mockup of what I'd like to do.
Try this plugin => r2tech-eclipse
The screenshot shows AntView that lists buildfiles with path.
EDIT : doesn't work with Eclipse 3.7.x (Indigo), the latest release is from 2002.
Sources are available for download, so you may use it to patch the ant view eclipse ships with.The eclipse builtin ant view should provide the same features.
Another option is to fill a bug report with a feature request for the ant view.
For accessing the buildfilelocation from inside the build script make the projectpathavailable as property for ant like that :
Window > Preferences > Ant > Runtime > Properties
and create a property named projectpath with value :
${project_loc}
then in your buildscript use something like :
<echo>$${projectpath} => ${projectpath}</echo>
Doesn't look like this is currently possible. I filed a bug report with the Eclipse project, so more information may be available at a future date. The link to the bug report is below
https://bugs.eclipse.org/bugs/show_bug.cgi?id=403514
I'm using Eclipse to learn to develop Android applications in Java. I haven't used Eclipse before.
The project I'm trying to use (supplied by OReilly as part of 'Android Application Development') is MJAndroid. When attempting to run the project, the Run fails, and the Problems tab mentions com.java.Object can't be found, and Eclipse asks me to check the build path. Clicking
Properties -> Java Build Path -> Libraries, the message 'Unable to get system library for the project' is displayed.
On a working project, Properties -> Java Build Path -> Libraries has an entry for Android 1.1, which if I click Edit, has the classpath container path of com.android.ide.eclipse.adt.ANDROID_FRAMEWORK.
It seems a simple matter of adding the correct container path to my non-working project. However Eclipse seems determined to make this as difficult as possible. No matter what I chose to add - jars, externals jars, variables, libraries, class folders, external class folders, nothing seems to take the form of 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' that the 'Android 1.1' entry on the working app has.
How can I add this namespace to my project so it resembles the working one?
I'm quite sure it's a problem with Eclipse's somewhat odd user interface. Frankly there' nothing I'd prefer more than a file to modify and set such information - my background is in Python, and the whole eclipse environment seems an unnecessary burden.
I had faced the same issue when I imported a sample code downloaded from the internet. I am using android sdk 1.5 with 0.9 ADT plugins. Here is a simpler way to fix the andoid library reference issues
Right click on the project which has
issues and select properties
Select the appropriate Android build
(1.1, 1.5 or 1.5 with google api) and
say ok
Again right click on the project and
select "Android Tools > Fix Project
Properties"
Fix the imports once (if required)
Refresh the project and you should be
ready to go without any manual
editing
I faced this same problem after importing a project through GIT. The problem was that I didn't have the same target android platform installed, and the build path somehow got corrupted.
The first obvious thing i did was changing the target sdk in the project.properties, but even after cleaning up the project and Android Tools > Fix Project Properties, it didn't help and I was still getting the build error.
My solution after wasting close to 1 hour trying to figure this out?
RESTART ECLIPSE
Everything worked fine after that. Eclipse is pretty fickle. Only through years of experience you'll then understand her well. :)
Had the same problem and it turns out the Android SDK Location was not set which was a really simple fix. Go to Window->Preferences, click on 'Android' on the left hand menu, fill in the location of the Android SDK (e.g. C:\Program Files\Android\android-sdk) and click OK. Everything worked fine for me after that.
Found the answer in this set up guide: http://developer.motorola.com/docstools/library/Installing-Android-Dev-Environment/
Sometimes Eclipse can get a bit funny (technical term) with classpath container resolution.
You have a working project in your workspace, so you can rule out plugin installation issues. You could try opening the .classpath file (hidden by default, select the triangle in the top-right of the Package Explorer view, select Filters... and uncheck .* resources) and manually adding the container declaration.
`<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>`
You may then have to close the project and open it again (right-click->Close Project) before Eclipse recognises the change.
You may also find that there is an Android builder and/or nature. If you compare the .project files for the working and non-working versions you may see entries for Android builders/natures. Copying the relevant entries may resolve the issue.
sometimes, eclipse can help you.
In Android projects, click right button on the project-> Android Tools -> Fix Project Properties.
It's usefull in class path errors!!
Luck!
I would verify you have the correct version of Java installed as well as the Android SDK. I would recommend installing/reinstalling the ADT plugin in your eclipse, makes it alot easier to create the android project.
http://developer.android.com/sdk/1.5_r2/installing.html
Also. I guess the path of the Android SDK must be setup correctly. This happened when I was overloaded with projects and I decided to create a new workspace copying some existing stuff into it.
Seems that the new workspace requires you to setup these details too once again
Is that setup properly?