aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes About  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "About  ".classpath" file in the project" Watch "About  ".classpath" file in the project" New topic
Author

About ".classpath" file in the project

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I am using Eclipse 3.0. I create a new java project. I find the Eclipse give me .classpath file. If I want to build Ant build file, how can I set property name to include that ".classpath" into my Ant file classpath?

I like Eclipse more and more.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Take a look at http://www.eclipse-plugins.info/eclipse/plugin_details.jsp?id=700


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
I would say that the other way around is the correct one ;-) (I mean creating the .classpath out of the ant build). Why this? Ant is more spread and it is not recommended to require all the developers to use Eclipse.

just my 2c
./pope


blog - InfoQ.com
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Ali,
But many companies have a standard IDE. If you are using a standard IDE, it is easier to maintain the code in the IDE and just let ant do builds/integration checks.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Originally posted by Jeanne Boyarsky:
Ali,
But many companies have a standard IDE. If you are using a standard IDE, it is easier to maintain the code in the IDE and just let ant do builds/integration checks.


Yep I know that. But still, Ant is a standard (and it has more chances to remain)!. An IDE adoption may change sooner or later.

./pope
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Edward Chen:
I am using Eclipse 3.0. I create a new java project. I find the Eclipse give me .classpath file. If I want to build Ant build file, how can I set property name to include that ".classpath" into my Ant file classpath?

I like Eclipse more and more.


.classpath file of eclipse project is has format data like XML file, So, i think, you can not refer to this file from ant.(build.xml).

But you can config data in build.xml to refer to all librarys in .classpath file like this ::


< !-- Set Classpath of Libraries -->

<path id="lib.class.path">
<fileset dir="${dist}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${build}">
<include name="**/*.class"/>
</fileset>
</path>

[ September 28, 2004: Message edited by: somkiat puisungnoen ]
[ September 28, 2004: Message edited by: somkiat puisungnoen ]

SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Ali Pope:
Yep I know that. But still, Ant is a standard (and it has more chances to remain)!. An IDE adoption may change sooner or later.


True, on the other hand the .classpath file is very simple XML and wouldn't be too hard to edit manually - not harder than any other format, I'd think.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Originally posted by Ilja Preuss:


True, on the other hand the .classpath file is very simple XML and wouldn't be too hard to edit manually - not harder than any other format, I'd think.


It is also easy to have it generated from the Ant (2 xmls and 1 xslt). The only problem would be that there is no standard way to create Ant build files and so a generic solution cannot be offered.

./pope
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Ali Pope:
It is also easy to have it generated from the Ant (2 xmls and 1 xslt).


True, but when you do it the other way around, you also have a nice tool to maitain the file - eclipse itself...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About ".classpath" file in the project
 
Similar Threads
Coexistence between IDE builds and automated
automation project creation
How to import a web project in eclipse?
Problem with Eclipse and the servicegen task of weblogic
Import statement runtime error