Modify and rebuild Openfire plugin - java

I am trying to modify the message monitoring plugin in Openfire.
I checked-out the code using svn. And i could also figure out what and where i will need to change the code. But I am not clear about rebuilding the plugin and testing my changes.
In Eclipse, I can export the "plugins.monitoring" package as a .jar, but it does not export all the classes. For example, it exports plugins.monitoring.src.web but ignores classes in sub-packages (if i am not wrong with the term) such as plugins.monitoring.src.java.org.jivesoftware.openfire.reporting.util.
How do I compile only one package and export it to .jar file?
Thanks

I got how to do this. It is to be done using ant
build.xml can be found in the build directory inside the Openfire source code

Related

How do I build and run an existing project in Eclipse?

I would like to start the program from this repository: https://github.com/SaifurRahmanMohsin/Personal-Diary but when I dowload it and open the project in Eclipse I am not able to build/compile it. So i also can't run it.
Do I have to change run configurations or build a working set or something like that? I usually don't work with Eclipse so I am a bit overwhelmed.
screenshot eclipse1
screenshot eclipse2
Check out. Delete the files .project, .classpath, and folder .settings before you import because those hold data unrelated to your system.
File, Import, Project from existing sources
Pick the inner Personal Diary folder, not the repo folder
You will need to download two libraries to add to the classpath
JSON-Simple and Apache HTTP Client

Adding plain Java project as a classpath to an eclipse plugin

I have a plain Java project (not a plugin project) which I want to add to a classpath of a eclipse plugin which I am developing. But in web projects I can add that project as a build path and it works fine. But I tried same thing in eclipse plugin, I am able to compile successfully, but at run time I am getting java.lang.ClassNotFoundException.
I know OSGi quite well and I know how to add OSGi into an classpath (using export-packages) but what I want is to add Standard, non-osgi project into an classpath, so that I wont' get runtime errors. Is there anyway I can achieve this?
I can export project as a jar file or make it as a plugin project and it would work fine. But that's not my option currently because, still that API is in pre-alpha stage, and there would be lot of changes going on. So I am trying to avoid pain of exporting it as jar file everytime. Is there any option for me other than this?
I have a similar situation: I want non-OSGi Maven dependencies integrated into the classpath of my plugin. I succeeded with a roundabout solution, which I think is the best I could get.
I have a build step outside of Eclipse where I copy the class files of the dependency into the plugin's lib folder. The lib folder is specified in MANIFEST.MF as an entry in Bundle-ClassPath and (here comes the hack) as a source folder in build.properties. That was the only way to make the plugin work both when launched from within Eclipse and when exported.

How do I ignore Eclipse errors if I include junit.jar from somewhere else?

Basically, I created a build.xml for Apache Ant. I use all the .jar files such as easymock.jar, junit.jar, which I downloaded straight from the their websites for my library (set in build.xml).
When I created a new unit test file using those two above .jar files by:
import static org.easymock.EasyMock.expect;
import static org.junit.Assert.*;
Eclipse generated bunch of errors. However, when I ran build.xml as Ant, this didn't seem to be a problem (no compile errors). I guess Eclipse doesn't recognize the external libraries until it actually compiles. How do I ignore these errors for certain unit test files? Or more generally, make Eclipse recognize external libraries?
Look in Project properties->Java Build Path. This has options to add jars to your project.
Simply putting the jar files in the project does not guarantee that it is included in the Project Class path. You need to set it manually.
In Properties-->Java Build Path, add a User Library (for example) and include your jar files there.

How to use Java WTK project together with SVN?

I tried to create a project in WTK which I'm using for SVN commits. My problem is that every time I create the .jar package those .svn/ directories appear in it...
Is there any build script the Wireless Toolkit uses that I could modify to avoid including .svn folders to the packages? Or maybe better solution?
You can build an Ant script to package explicitly the directories you need using the jar task. Ant also includes an SVN extension to allow exporting a clean tree without the .svn files. Ant by default excludes .svn directories as noted here.

How do I add a build.xml to an existing GWT project in Eclipse?

I have a running Java GWT application, that I can compile using Eclipse.
Now I wan't to also be able to build this application from the command line using ant.
As of my understanding I therefore need a build.xml file.
I used the webAppCreator tool, that comes with the SDK to create this build.xml file and adapted it to my needs and got it working.
But how do I tell Eclipse now to automatically update the build.xml file upon code changes?
I know it is possible for it works in projects created with webAppCreator. But I just copied the build.xml to another project. So what do I need to adapt? Or where do I need to set up the link to the build.xml?
You could use Ant4Eclipse to get the Eclipse classpath into your ant build file. That's probably only part of the solution you're looking for... I'm not sure, how useful this will actually be when used together with a GWT project (do you want automatic copying of the libraries to WEB-INF/lib, too? Etc...)

Categories

Resources