How to import and run ivy+ant project in eclipse juno - java

this is my first use of ivy+ant and after building the project from command line, i want to import it into eclipse juno.
the project folder (trunk) contains the following folders/files:
build
dist
src
WebContent
build.properties
build.xml
ivy.settings.xml
ivy.xml
i tried to import the trunk folder that contains the above files/folder using import existing projects into workspace, but i get the error that no projects found.
pleases advise how to import this project.
UPDATE: i tried to configure the project for eclipse before importing using the following command:
ant eclipse-default
but i get the following error:
Target "eclipse-default" does not exist in the project
UPDATE 2:
i was able to import the project in eclipse as follows
File > New > Other > Java Project From Existing Ant Buildfile
but when trying to run the project on server, i can't find run on server in the run options, please advise.

You may try this:
Install IvyDE from http://www.apache.org/dist/ant/ivyde/updatesite (ref: http://ant.apache.org/ivy/ivyde/download.cgi)
IvyDE may not recognize your setting and properties file. At Window -> Preference -> Ivy -> Settings, check reload the setting on demand, add Ivy setting path ivysettings.xml or your Ivy setting file, Property files build.properties or your Ant properties file.
Add new Java project you want to work on, point the path to your project.
At the new project wizard, Libraries tab -> Add Library -> IvyDE Managed Dependencies.

You can not import a project of you do not have the eclipse project information in your code.
Either create a new eclipse project from existing source.
Or a new java project from ant buildfile (your update 2).
For running need configuration of server (hard to know what youneed there), you may need to create new server (preference/server/run time environnement) (or from view server, right click "new")

Related

Adding Java builder to .project file in Eclipse

I need to add a Java builder to mt .project file in Eclipse. However, there is no such file in my project folder. I don't know where this file is, maybe you can help me out?
In Eclipse, the .project file is kept in the root directory of your project, which is in your workspace. It's easy to see if you do a directory listing in your underlying filesystem. If you want to find out where your workspace is, find it by looking at the project in the Package Explorer. right-click > Properties > Resource > Location.
It might be better to use Eclipse itself to add a builder to your project, for example, using the Package Explorer - project right-click > Properties > Builders feature.
Convert the project into a faceted project. This generally happens when you import a project from git and the project is not a java project.
Steps:
Right Click -> Properties -> Project Facets
Click on convert project into a faceted project
Select the builder as java builder.

Importing a Log4j source in eclipse

I am trying to import the latest Log4j2 source in my eclipse and Eclipse is not detecting it as a project. it says 'No projects are found to import'. Is there a solution for this?
My goal is to make a jar out of this source. Can i do that without the need to importing it on my eclipse(maybe like a command line solution that can make a build for me)?
Eclipse is not detecting it as a project. it says 'No projects are found to import'. Is there a solution for this?
It's a maven project, so you should import Existing Maven Project
Can i do that without the need to importing it on my eclipse(maybe like a command line solution that can make a build for me)?
A simple jar command. You can see more at Using JAR Files: The Basics. A basic command example
> jar cf log4j-sources.jar * // the * is for all files in the current directory
Note: this will not build anything. Just put everything into a jar.
If you have maven you can ask maven to generate the Eclipse .project and .classpath files.
From the log4j2 top-level folder, run mvn eclipse:eclipse
Eclipse will now be able to recognize each module as a project.
After this, to import modules in Eclipse, take the following steps for each module:
File > New > Java Project - enter module name (e.g. log4j-api) for Project name, uncheck "Use default location" and click Browse... to navigate to the location of the log4j-api module. Then click Finish on the wizard.

eclipse doesn't see java file generated during installation of maven module

I am working on a specific maven module. I have it imported into eclipse by m2eclipse plugin. The module uses our internal plugin to generate java files from some csv files. During install goal those files are being generated and put to target/generated-sources/folder_name.
Can you tell me how I can import these java files into eclipse so it stops showing me compilation errors saying that 'x' cannot be resolved to a type?
Now every module which uses those files has compilations errors in eclipse, everything works fine when I try to build from command line.
Thanks in advance.
UPDATE: Thanks a lot guys, I was trying similar solution but instead of adding source folder I was trying to add external classes :|
project -> properties -> java build path -> source -> add folder -> (search for target/generated-sources/folder_name, create it if deleted by maven) -> ok
now eclipse will only complain when you'll use mvn clean deleting target folder.
Eclipse refreshes file content on request, so any change made external to eclipse, eclipse doesn't know about that
You can make eclipse to use native hooks to detect external changes
preference > workspace > check refresh using native hooks
and add that directory to source path
You probably need to add the folder of the generated files as a Source folder in the project. Look in the Project Properties > Java Build Path > Source tab and add the folder.

import a web project using ant build file

I have a web project from TrortoiseSVN. When I import this project into workspace using ANT build.xml it become a simple java project. It is not recognize the web-inf and web root folder.
How I import this project into workspace?
You can make an empty project like you want, and then copy the file to the project which you created. And then enter "F5" to see it or not success!
For Juno, do File->New->Other, then select File -> New -> Other, and at the New dialog, select Java Project from Existing Ant Buildfile
try importing the project in a different way, maybe import it as an existing project into eclipse

Cannot import spring mvc project property into eclipse

I am trying to import the project at http://www.javaworld.com/javaworld/jw-04-2009/jw-springmvc-cms-src.zip into eclipse.
I do File -> New -> Project.. -> Java Project From Existing Ant Buildfile. I give the path of the build.xml of the project.
It imports the project into eclipse and shows the src and test folders. However, it does not show the WEB-INF, css etc. folders. Why? How can they also be viewed in the project structure in Eclipse.
You should try creating "by hand" the missing folders into your newly created project, then you can use Import -> File system to add the missing files into the respective folders...

Categories

Resources