Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-core-dev] intercepting .classpath load and save

IJavaElementDelta.F_CLASSPATH_CHANGED tells you when the .classpath
changes.

Please ask such questions on the eclipse.tools.jdt newsgroup (this list is
about the development of JDT Core itself).



                                                                           
             "Faron Dutton"                                                
             <fdutton@bellsout                                             
             h.net>                                                     To 
             Sent by:                  <jdt-core-dev@xxxxxxxxxxx>          
             jdt-core-dev-admi                                          cc 
             n@xxxxxxxxxxx                                                 
                                                                   Subject 
                                       [jdt-core-dev] intercepting         
             03/18/2005 12:25          .classpath load and save            
             PM                                                            
                                                                           
                                                                           
             Please respond to                                             
               jdt-core-dev                                                
                                                                           
                                                                           




Hi All,

In my shop, we use Maven for the build system. It is easy to get the
.classpath file and the project.xml file out-of-sync, so I'm looking for a
way to override the classpath entries in the .classpath file with the
dependency entries in the project.xml file. I have used the MavenIDE
plug-in
from CodeHaus, which has a POM Synchronize view. However, this solution
requires that the developer actually remember to synchronize when adding a
new library to the classpath. Since there are over one-hundred people
working on these projects, if each person forgets once a year then the
build
is broken every other working-day.

What I would like to do is write a plug-in that either decorates or extends
JavaProject. In this new class, I can intercept the readClasspathFile and
saveClasspath methods to keep the files in sync. Unfortunately,
JavaModelManager is a singleton so there is no way to override which
implementation classes are instantiated.

Another solution would be to write a plug-in that modifies the classpath on
startup and then listens for classpath changed events to keep the
project.xml file up-to-date. I am once again foiled since I cannot see any
listener mechanism in the code.

Any thoughts or suggestions on how I can accomplish this?

Faron.

_______________________________________________
jdt-core-dev mailing list
jdt-core-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-core-dev




Back to the top