3

I have a plugin source folder which contains some plugin clases and META-INF folder with some manifests. In another source folder I have my main application. What I would like to do is to create a JAR file out of my plugin folder and add it to the classpath as soon as I click on the run button for my main application class. Preferably, Eclipse should create JAR files on the fly as soon as I make a change to any of the files within the plugin folder, kind of the way it automatically creates .class files in the default output folder (${projectname}/bin)

I only need this to make testing easier. Can it be done in Eclipse without the need to rely on ANT or something similar?

Pass
  • 1,501
  • 4
  • 21
  • 39
  • Why don't you want to rely on Eclipse but not on ANT or similar? The other way I could understand, but preferring a dependency to your IDE instead of Ant is a bit curious... – Tom Seidel Feb 26 '11 at 15:04
  • 2
    Why do you need to create a jar in the first place when testing changes from Eclipse? Just add project dependency in Java Build Path section of project properties from your main project to your plugin. Eclipse will make sure that plugin classes are visible when running your main project. Then you can have an external build for packaging your stuff for production into jars. In general, you want to avoid jar creation during development as that's a fairly expensive operation to do on ongoing basis if your code base isn't very small. – Konstantin Komissarchik Feb 26 '11 at 20:12

1 Answers1

1

Like this?:

How Do I Automatically Generate A .jar File In An Eclipse Java Project

Community
  • 1
  • 1
jberg
  • 4,758
  • 2
  • 20
  • 15