The JUpload package is available from several sources:
In both mode, we recommand to install maven, to get the most up-to-date compilation way. You'll find all details, in the How to install Maven?, below. You can also use ant build, with the given build.xml file. See details in the Compile with the given Ant build file page, below.
You can work with the IDE you want. JUpload was tested with both Eclipse and Netbeans. Eclipse makes it simpler, because applet debugging is embedded. With Netbeans, you'll need to attach the debugger to the running applet (see below).
But to compile within Eclipse, you'll need some specific tasks (installing the maven plugin or run the build.xml file), where Netbeans compilation of JUpload is native, starting from the 6.7 version of Netbeans. For previous version, you'll need to install the relevant plugin (see Netbeans documentation, for all details).
So, we recommand Eclipse as an IDE for JUpload, if you currently have no IDE installed. Otherwise ... keep the one you have.
Note: If you're using another IDE, or have any comment on this documentation, please post a little 'howto' for JUpload compiling for your IDE. Please do this in the open discussion sourceforge forum.
You can build JUpload with both ant or maven tools. ant looks easier, as it is often installed with Java IDE, like Eclipse. But maven allows automatization of a lot of tasks, and is better on the long run. With both Eclipse (once the maven plugin is installed) and Netbeans, using maven is natural, and is recommanded.
Here are the main points to take into account, if you don't want to use maven:
Four parts here:
Since 5.0.0rc4, JUpload is built with Maven. The maven version used is 2.2.x. Previous JUpload versions are built with native Eclipse compilation or with the provided build.xml ant file.
Maven has a lot of advantages, and some drawbacks.
The main advantages are:
The main drawbacks are:
Maven command-line can be downloaded from http://maven.apache.org/. This tools is necessary to execute all commands starting with 'mvn'.
Maven Eclipse plugin installation is detailed, in the Eclipse paragraphe, below.
JUpload needs some specific information, especially for signing. To do this, you'll have to create a JUpload profile in your maven settings.xml file. For all details about this file, especially where it is, and how to protect passwords, please go to this page: http://maven.apache.org/settings.html
The full profile, needed for JUpload, is:
<settings> ... <profiles> ... <profile> <id>jupload</id> <activation> <activeByDefault>false</activeByDefault> </activation> <properties> <!-- The next parameters are mandatory, for applet signing. Default behavior, in the pom, is to generate these parameters, if you didn't define them in your settings.xml. So, they are optional in your settings. If you don't define them, JUpload will use a generated keystore, with a certificate generated at compile time. BUT: if you want to PUBLISH the applet to real life users, you SHOULD define them. See the howto-compile on the JUpload site, for details --> <jupload.keystore.alias>Alias for your key in your keystore</jupload.keystore.alias> <jupload.keystore.filename>Full path for your keystore file</jupload.keystore.filename> <jupload.keystore.storepass>Password for your keystore</jupload.keystore.storepass> <!-- The next parameters are mandatory only for publishing Maven artefact to your repositories, that is: when you use the "deploy" maven goal. Useless when you 'just' compile, that is: when you use the 'install' maven goal. There is currently no 'Central' jupload repository --> <jupload.distributionManagement.repository.id>Id_for_your_main_repository</jupload.distributionManagement.repository.id> <jupload.distributionManagement.repository.name>Name_for_your_main_repository</jupload.distributionManagement.repository.name> <jupload.distributionManagement.repository.url>URL_for_your_main_repository</jupload.distributionManagement.repository.url> <jupload.distributionManagement.snapshotRepository.id>Id_for_your_main_snapshotRepository</jupload.distributionManagement.snapshotRepository.id> <jupload.distributionManagement.snapshotRepository.name>Name_for_your_main_snapshotRepository</jupload.distributionManagement.snapshotRepository.name> <jupload.distributionManagement.snapshotRepository.url>URL_for_your_main_snapshotRepository</jupload.distributionManagement.snapshotRepository.url> <!-- The next parameters are mandatory only for PGP signing. PGP signing is used only when performing a release, that is: when executing the goal release:perform Not used (so: optional) otherwise. PGP signing is only used for developpers who would like to publish a new JUpload version to the Maven Central Repository. For all other users, you can let skip to true. --> <jupload.pgp.keyname>Name of your PGP key</jupload.pgp.keyname> <!-- The passphrase is optional: if not provided, it will be asked to the user --> <jupload.pgp.passphrase>Passphrase for your PGP key</jupload.pgp.passphrase> <!-- The next parameters are mandatory only for use of the maven release plugin. Optionnal otherwise. So for standard use of JUpload (without creating releases), you can let this parameter unchanged --> <jupload.scm.username>Login for the Sourceforge Source Configuration Manager</jupload.scm.username> <jupload.scm.password>Password for the Sourceforge Source Configuration Manager</jupload.scm.password> </properties> </profile> ... </profiles> ... </settings>
Compiling with Maven can be done by using your favorite IDE. You can also use any terminal or command window, and type this command
The constructing of the whole site is included in the given pom.xml file, like any standard maven project. The standard command to build your web site is:
This aboce command will construct the whole site but not the applet. You can then execute a mvn install, to add the built and signed applet to the existing site, or construct both the the site and the applet in one step:
mvn site install
The generation of the whole site is long, because of the reporting plugins which are added to the JUpload pom. To speed it, you can prevent the reporting to be executed. You can also prevent the JUnit test to be executed:
mvn site install -Dskip.reporting -Dmaven.test.skip
The ant build files can be generated from the maven pom.xml file, by the Imaven-ant-plugin/I. This plugin will generate the maven-build.xml and maven-build.properties files. Take care that your password will get copied in the maven-build.properties file!. You'll have to 'clean' this file, before commiting this file to SVN.
To generate these files, just execute this maven command:
TODO: Use a specific profile, which will override your JUpload passwords.
An ant build file is given with JUpload, to generate two main targets:
ant -Djupload.keystore.alias=jupload -Djupload.keystore.filename=youKeystoreFile -Djupload.keystore.storepass=yourKeystorePass
Eclipse is the easiest way to develop the java stuff, like the applet. Go to http://Eclipse.org to download it. You can take the Java Developper edition, for instance.
You can then create your JUpload project from a JUpload release, or from the trunk.
Two Maven plugins for eclipse exist. Here is the doc to the m2eclipse plugin. It is available at http://m2Eclipse.sonatype.org/. You can install the core plugin from this Eclipse upload site: http://m2Eclipse.sonatype.org/sites/m2e. You should also, at least, install the SVN support from this Eclipse upload site: http://m2Eclipse.sonatype.org/sites/m2e-extras.
Caution: To run the m2Eclipse plugin, you'll need that Eclipse uses a JDK instead of JRE, like in standard Eclipse installation. To do this, edit the Eclipse.ini (in the root Eclipse folder), and add these two lines:
This step is necessary only if you plan to use SVN, for instance to check out the most up-to-date version of JUpload, from the sourceforge Subversion (conf management).
There are two Eclipse plugins for SVN: subversion (on polarion.org) and subclipse (on tigris.org). Both are good. I use the second one. An easy way to install it is to use the Eclipse software management function.
To do this, you'll need to download a release file, from Sourceforge. The release files are zip files. The content of this zip files is described in the ./index.html page. Two folders exist, on the root of this zip file:
To create a new project for eclipse, you should:
The release files contains the necessary stuff to compile or hack the JUpload code. If you do this, please do not hesitate to post a message on the open discussion sourceforge forum. You can then explain the enhancement(s) you did, and post a patch. The Patches tracker is nice enough for that.
You must have Eclipse, with the subversion plugin installed, see details just above. Then, you have to do these steps:
You now have a SVN repository configured for the JUpload project. You'll now have to checkout the JUpload maven project. To do this:
This is the simplest way to compile and run the applet. Use the sources of the JUpload releases, without connection to the sourceforge.net subversion.
Create a new project:
In order to sign the applet, for use on a web site, you need to define your keystore and its password. To do this, when using the and biuld.xml file, you must define the jupload.keystore.filename and jupload.keystore.filename ant properties:
Then, to compile and sign the applet, you'll have to do this:
To launch the applet:
To set applet parameters:
To launch the applet a second time:
A general documentation, about using Maven with Netbeans, is available on this page: maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html.
Basically, maven support is native, starting from netbeans 6.8. But there is no debug support for the applet. So you have to connect yourself your debugger to the applet.