Making my own version of Spark

I have followed a few threads that I have seen out there on bringing Spark into eclipse, doing some editing, and then building and I have made it pretty far but I have run into a roadblock.

I have a project in eclipse that I can run and the spark client launches within just fine and with the changes I have made working correctly, the problem is that I can’t get it outside of eclipse. I know that I am just missing something and I hope someone out here will be kind enough to point me in the right direction. The programs in the past I have just exported an executable jar file but that doesn’t work with this. How do i get it outside of eclipse so we can distribute to the rest of our network?

Thanks,

Mike

Eclipse puts files into /target/build. But you won’t have an exe to start a program (there will be startup.bat in the bin folder, which starts Spark, but with a black cmd window). On this site install4j is used in the building system to produce installer and exe files. But it is a paid program and i don’t have any instructions on how to do this as it works automatically in our Bamboo system. Others use IzPack or other installer creating programs.

Another option is to just copy files from /target/build into an existing installation, replacing /lib and other folders with the updated files and leaving old exes in place. I think it should work.

Sorry, I can’t help, but I’m just wondering how you got Spark running through Eclipse? I’ve found some instructions (like this one or this one) but neither of them seem to work. Is there some up-to-date doc somewhere on how to actually build and run Spark in Eclipse?

Here’s mine short instruction for setting it up:

Setup Project in Eclipse with Git support:

File > Import > Git > Project from Git > Next

Clone URI > Next https://github.com/igniterealtime/Spark.git (Authentication not needed at this point) > Next

Select only “master” > Next

Select directory K:\Git\Spark > Next

wait until cloned

Import as a general project > Next > Finish

Right-click imported project and Delete (do not select deleting files on disk)

File > New > Java Project

Project name: Spark

Uncheck “use default location” and set directory to K:\Git\Spark > Finish

Build project:

Press Ant icon on the right

Add buildfiles > select Spark > build > build.xml

Right click Ant script > Run As > External Tools > Configurations… > select Ant script > JRE tab > select Run in the same JRE as the workspace > Apply > Close

Press Run Target button to build a project

run to launch - /target/build/bin/startup.bat

Thanks, that seems to have worked. The client opens and superficially seems OK, but I do get a stacktrace in the console:

SEVERE: Error Setting JTattoo

java.lang.ClassNotFoundException: com.jtattoo.plaf.luna.LunaLookAndFeel

    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

    at org.jivesoftware.Spark.loadLookAndFeel(Spark.java:285)

    at org.jivesoftware.Spark.startup(Spark.java:177)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:43)

    at java.lang.reflect.Method.invoke(Method.java:497)

    at org.jivesoftware.launcher.Startup.start(Startup.java:94)

    at org.jivesoftware.launcher.Startup.main(Startup.java:44)

It looks like these startup.bat/sh scripts setup some remote debugging, which should be useful.

I think I’m spoiled; I can’t believe that in this day and age an application like this isn’t built with Maven.

Simply put - no active developers to push it to Maven or just simply fix bugs.

spark can be build using ANT,

cd SparkDIR/build

ant jar

done

I think I’m spoiled; I can’t believe that in this day and age an application like this isn’t built with Maven.

Yes, it’s a shame. Even Openfire isn’t built with Maven yet and has all binaries commited in git. There are old Jira issues from 2012 to fix this situation, but efforts to migrating this are stuck currently.

I don’t mean to be dismissive, I know that a lot of effort surely went into creating the build process that’s currently in place, and it does work once you know how to do it.

The advantage of Maven in a case like this is that you generally wouldn’t have to find instructions somewhere in a forum to figure out how to get the project running in Eclipse (or any other modern IDE). Also, the generated jar file could have its dependencies bundled in it rather than needing to run a shell script that loads a classpath.