{"id":21387198,"url":"https://github.com/sshtools/jaul","last_synced_at":"2025-03-16T12:20:24.698Z","repository":{"id":168392146,"uuid":"606561219","full_name":"sshtools/jaul","owner":"sshtools","description":"JAdaptive Application Update Library","archived":false,"fork":false,"pushed_at":"2024-04-15T08:46:29.000Z","size":138,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-24T06:38:51.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sshtools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-25T21:22:24.000Z","updated_at":"2024-05-10T15:55:16.527Z","dependencies_parsed_at":null,"dependency_job_id":"59534c71-d68c-4135-9ba1-35885b3b5570","html_url":"https://github.com/sshtools/jaul","commit_stats":null,"previous_names":["sshtools/jaul"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fjaul","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fjaul/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fjaul/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshtools%2Fjaul/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sshtools","download_url":"https://codeload.github.com/sshtools/jaul/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243865433,"owners_count":20360443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T12:12:06.604Z","updated_at":"2025-03-16T12:20:24.681Z","avatar_url":"https://github.com/sshtools.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JADAPTIVE Application Update Library\n\nAdds update features to several Jadaptive projects via the Install4J runtime. Install4J itself is optional and only available in the EJ Technologies repository.\n\n## Add Update Support To An Application\n\nThere are 4 main areas that will need changing to add multi-channel update support to an application.\n\n * Maven\n * Java (ie. the Application itself)\n * Install4J Project\n * Jenkins Build  \n\n### Maven\n\nFirst add some `\u003cproperties/\u003e` tags.\n\n```xml\n\u003cbuild.phase\u003econtinuous\u003c/build.phase\u003e\t\n\u003cbuild.mediaTypes\u003ewindows,unixInstaller,macos,macosFolder,windowsArchive,unixArchive,linuxRPM,linuxDeb,macosArchive,macosFolderArchive\u003c/build.mediaTypes\u003e\n\u003cbuild.install4j.project\u003e${project.basedir}/installer.install4j\u003c/build.install4j.project\u003e\n\u003cbuild.projectProperties\u003e${basedir}/jadaptive.build.properties\u003c/build.projectProperties\u003e\n\u003cbuild.userProperties\u003e${user.home}/.jadaptive.build.properties\u003c/build.userProperties\u003e\n```\n\nNow you'll need a `\u003cdependency/\u003e`.\n\n```xml\n\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.install4j\u003c/groupId\u003e\n\t\u003cartifactId\u003einstall4j-runtime\u003c/artifactId\u003e\n\t\u003cversion\u003e10.0.4\u003c/version\u003e\n\t\u003c!-- MUST be provided, the runtime is added by I4J itself --\u003e\n\t\u003cscope\u003eprovided\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nYou'll also need *jaul* itself. If this is a JavaFX application, hopefully you are already using `jajafx`, or if this is a command line tool hopefully you are already using `command-utils`. Either of these handle the bulk of the integration, you just need to provide some details and initiate the update or update check according to your user interface needs.\n\nSo, if you are not already using either of the framework libraries, add another dependency.\n\n```xml\n\u003cdependency\u003e\n\t\u003cgroupId\u003ecom.sshtools\u003c/groupId\u003e\n\t\u003cartifactId\u003ejaul\u003c/artifactId\u003e\n\t\u003cversion\u003e0.0.2-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nNow you'll need to add some plugins. First off, copy and paste the following into a `\u003cbuild\u003e` / `\u003cplugins\u003e` section.\n\n```xml\n\n\u003cplugin\u003e\n\t\u003cgroupId\u003eorg.codehaus.mojo\u003c/groupId\u003e\n\t\u003cartifactId\u003eproperties-maven-plugin\u003c/artifactId\u003e\n\u003c/plugin\u003e\n\u003cplugin\u003e\n\t\u003cgroupId\u003eorg.codehaus.mojo\u003c/groupId\u003e\n\t\u003cartifactId\u003ebuild-helper-maven-plugin\u003c/artifactId\u003e\n\u003c/plugin\u003e\n```\n\nAnd then the following into `\u003cbuild\u003e` / `\u003cpluginManagement\u003e` / `\u003cplugins\u003e`. \n\n```xml\n\u003cplugins\u003e\n\t\u003cplugin\u003e\n\t\t\u003cgroupId\u003eorg.codehaus.mojo\u003c/groupId\u003e\n\t\t\u003cartifactId\u003eversions-maven-plugin\u003c/artifactId\u003e\n\t\t\u003cversion\u003e2.15.0\u003c/version\u003e\n\t\u003c/plugin\u003e\n\t\u003cplugin\u003e\n\t\t\u003cgroupId\u003eorg.codehaus.mojo\u003c/groupId\u003e\n\t\t\u003cartifactId\u003eproperties-maven-plugin\u003c/artifactId\u003e\n\t\t\u003cversion\u003e1.0.0\u003c/version\u003e\n\t\t\u003cexecutions\u003e\n\t\t\t\u003cexecution\u003e\n\t\t\t\t\u003cphase\u003einitialize\u003c/phase\u003e\n\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\u003cgoal\u003eread-project-properties\u003c/goal\u003e\n\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\u003cquiet\u003etrue\u003c/quiet\u003e\n\t\t\t\t\t\u003cfiles\u003e\n\t\t\t\t\t\t\u003cfile\u003e${build.projectProperties}\u003c/file\u003e\n\t\t\t\t\t\t\u003cfile\u003e${build.userProperties}\u003c/file\u003e\n\t\t\t\t\t\u003c/files\u003e\n\t\t\t\t\u003c/configuration\u003e\n\t\t\t\u003c/execution\u003e\n\t\t\u003c/executions\u003e\n\t\u003c/plugin\u003e\n\t\u003cplugin\u003e\n\t\t\u003cgroupId\u003eorg.codehaus.mojo\u003c/groupId\u003e\n\t\t\u003cartifactId\u003ebuild-helper-maven-plugin\u003c/artifactId\u003e\n\t\t\u003cversion\u003e3.3.0\u003c/version\u003e\n\t\t\u003cexecutions\u003e\n\t\t\t\u003c!-- The build number. This will be set to ZERO if BUILD_NUMBER is not \n\t\t\t\tset. Jenkins will set BUILD_NUMBER, or you can set it in the environment \n\t\t\t\tbefore running maven for build testing. --\u003e\n\t\t\t\u003cexecution\u003e\n\t\t\t\t\u003cid\u003ebuild-number-property\u003c/id\u003e\n\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\u003cgoal\u003eregex-property\u003c/goal\u003e\n\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\u003cphase\u003einitialize\u003c/phase\u003e\n\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\u003c!-- Set build.number to zero if it is blank. This uses a bit of regular \n\t\t\t\t\t\texpression trickery. Because Jenkins supplies BUILD_NUMBER as an environment \n\t\t\t\t\t\tvariable, and we also want the build to work outside of Jenkins, then the \n\t\t\t\t\t\tbelow is used to set build.number to zero if BUILD_NUMBER is not set. There \n\t\t\t\t\t\tis no easy way to do this with basic Maven, and build-helper doesn't like \n\t\t\t\t\t\tempty variables either, so we prefix it with zero, then use capture groups \n\t\t\t\t\t\tto correct the format for both situations --\u003e\n\t\t\t\t\t\u003cname\u003eproduct.version\u003c/name\u003e\n\t\t\t\t\t\u003cvalue\u003e${project.version}\u003c/value\u003e\n\t\t\t\t\t\u003cregex\u003e^([0-9]+)\\.([0-9]+)\\.([0-9]+)-([0-9A-Za-z]+)$\u003c/regex\u003e\n\t\t\t\t\t\u003creplacement\u003e$1.$2.$3\u003c/replacement\u003e\n\t\t\t\t\t\u003cfailIfNoMatch\u003efalse\u003c/failIfNoMatch\u003e\n\t\t\t\t\u003c/configuration\u003e\n\t\t\t\u003c/execution\u003e\n\t\t\t\u003cexecution\u003e\n\t\t\t\t\u003cid\u003eproduct-version-property\u003c/id\u003e\n\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\u003cgoal\u003eregex-property\u003c/goal\u003e\n\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\u003cphase\u003einitialize\u003c/phase\u003e\n\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\u003c!-- Strip off -SNAPSHOT (or other suffix) --\u003e\n\t\t\t\t\t\u003cname\u003ebuild.number\u003c/name\u003e\n\t\t\t\t\t\u003cvalue\u003e0${env.BUILD_NUMBER}\u003c/value\u003e\n\t\t\t\t\t\u003cregex\u003e^(?:0?)([0-9]+)(?:\\$\\{env\\.BUILD_NUMBER\\})?$\u003c/regex\u003e\n\t\t\t\t\t\u003creplacement\u003e$1\u003c/replacement\u003e\n\t\t\t\t\t\u003cfailIfNoMatch\u003efalse\u003c/failIfNoMatch\u003e\n\t\t\t\t\u003c/configuration\u003e\n\t\t\t\u003c/execution\u003e\n\t\t\u003c/executions\u003e\n\t\u003c/plugin\u003e\n\t\u003cplugin\u003e\n\t\t\u003cgroupId\u003ecom.install4j\u003c/groupId\u003e\n\t\t\u003cartifactId\u003einstall4j-maven\u003c/artifactId\u003e\n\t\t\u003cversion\u003e10.0.4\u003c/version\u003e\n\t\u003c/plugin\u003e\n\t\u003cplugin\u003e\n\t\t\u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n\t\t\u003cartifactId\u003emaven-antrun-plugin\u003c/artifactId\u003e\n\t\t\u003cversion\u003e1.8\u003c/version\u003e\n\t\u003c/plugin\u003e\n\u003c/plugins\u003e\n```\n\nYou'll also need some `\u003crepositories/\u003e` and `\u003cpluginRepositories\u003e`.\n\n```xml\n\u003crepositories\u003e\n\t\u003crepository\u003e\n\t\t\u003cid\u003eoss-snapshots\u003c/id\u003e\n\t\t\u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n\t\t\u003csnapshots /\u003e\n\t\t\u003creleases\u003e\n\t\t\t\u003cenabled\u003efalse\u003c/enabled\u003e\n\t\t\u003c/releases\u003e\n\t\u003c/repository\u003e\n\t\u003crepository\u003e\n\t\t\u003cid\u003eej-technologies\u003c/id\u003e\n\t\t\u003curl\u003ehttps://maven.ej-technologies.com/repository\u003c/url\u003e\n\t\u003c/repository\u003e\n\u003c/repositories\u003e\n\u003cpluginRepositories\u003e\n\t\u003cpluginRepository\u003e\n\t\t\u003cid\u003eej-technologies\u003c/id\u003e\n\t\t\u003curl\u003ehttps://maven.ej-technologies.com/repository\u003c/url\u003e\n\t\t\u003creleases /\u003e\n\t\t\u003csnapshots\u003e\n\t\t\t\u003cenabled\u003efalse\u003c/enabled\u003e\n\t\t\u003c/snapshots\u003e\n\t\u003c/pluginRepository\u003e\n\u003c/pluginRepositories\u003e\n```\n\nNow add a new `\u003cprofile\u003e` that is activated by the `buildInstaller` system property.\n\n```xml\n\u003cprofile\u003e\n\t\u003cid\u003einstall4j-installers\u003c/id\u003e\n\t\u003cactivation\u003e\n\t\t\u003cproperty\u003e\n\t\t\t\u003cname\u003ebuildInstaller\u003c/name\u003e\n\t\t\t\u003cvalue\u003etrue\u003c/value\u003e\n\t\t\u003c/property\u003e\n\t\u003c/activation\u003e\n\t\u003cbuild\u003e\n\t\t\u003cplugins\u003e\n\t\t\t\u003cplugin\u003e\n\t\t\t\t\u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n\t\t\t\t\u003cartifactId\u003emaven-antrun-plugin\u003c/artifactId\u003e\n\t\t\t\t\u003cexecutions\u003e\n\t\t\t\t\t\u003cexecution\u003e\n\t\t\t\t\t\t\u003cphase\u003epackage\u003c/phase\u003e\n\t\t\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\t\t\u003ctarget\u003e\n\t\t\t\t\t\t\t\t\u003ccopy file=\"${project.build.directory}/${project.artifactId}-${project.version}.jar\" tofile=\"${project.build.directory}/${project.artifactId}.jar\" /\u003e\n\t\t\t\t\t\t\t\u003c/target\u003e\n\t\t\t\t\t\t\u003c/configuration\u003e\n\t\t\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\t\t\u003cgoal\u003erun\u003c/goal\u003e\n\t\t\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\t\u003c/execution\u003e\n\t\t\t\t\u003c/executions\u003e\n\t\t\t\u003c/plugin\u003e\n\t\t\t\u003cplugin\u003e\n\t\t\t\t\u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n\t\t\t\t\u003cartifactId\u003emaven-dependency-plugin\u003c/artifactId\u003e\n\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\u003coutputDirectory\u003e${project.build.directory}/dependencies\u003c/outputDirectory\u003e\n\t\t\t\t\u003c/configuration\u003e\n\t\t\t\t\u003cexecutions\u003e\n\t\t\t\t\t\u003cexecution\u003e\n\t\t\t\t\t\t\u003cid\u003ecopy-dependencies\u003c/id\u003e\n\t\t\t\t\t\t\u003cphase\u003epackage\u003c/phase\u003e\n\t\t\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\t\t\u003cgoal\u003ecopy-dependencies\u003c/goal\u003e\n\t\t\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\t\t\u003cstripVersion\u003etrue\u003c/stripVersion\u003e\n\t\t\t\t\t\t\t\u003coutputDirectory\u003e${project.build.directory}/dependencies/common\u003c/outputDirectory\u003e\n\t\t\t\t\t\t\t\u003cstripVersion\u003etrue\u003c/stripVersion\u003e\n\t\t\t\t\t\t\u003c/configuration\u003e\n\t\t\t\t\t\u003c/execution\u003e\n\t\t\t\t\u003c/executions\u003e\n\t\t\t\u003c/plugin\u003e\n\t\t\t\u003cplugin\u003e\n\t\t\t\t\u003cgroupId\u003ecom.install4j\u003c/groupId\u003e\n\t\t\t\t\u003cartifactId\u003einstall4j-maven\u003c/artifactId\u003e\n\t\t\t\t\u003cexecutions\u003e\n\t\t\t\t\t\u003cexecution\u003e\n\t\t\t\t\t\t\u003cid\u003ecompile-installers\u003c/id\u003e\n\t\t\t\t\t\t\u003cphase\u003epackage\u003c/phase\u003e\n\t\t\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\t\t\u003cgoal\u003ecompile\u003c/goal\u003e\n\t\t\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\t\t\t\u003cvariables\u003e\n\t\t\t\t\t\t\t\t\u003cbuild.phase\u003e${build.phase}\u003c/build.phase\u003e\n\t\t\t\t\t\t\t\u003c/variables\u003e\n\t\t\t\t\t\t\t\u003crelease\u003e${product.version}-${build.number}\u003c/release\u003e\n\t\t\t\t\t\t\t\u003cmediaTypes\u003e${build.mediaTypes}\u003c/mediaTypes\u003e\n\t\t\t\t\t\t\t\u003cprojectFile\u003e${build.install4j.project}\u003c/projectFile\u003e\n\t\t\t\t\t\t\u003c/configuration\u003e\n\t\t\t\t\t\u003c/execution\u003e\n\t\t\t\t\u003c/executions\u003e\n\t\t\t\u003c/plugin\u003e\n\t\t\u003c/plugins\u003e\n\t\u003c/build\u003e\n\u003c/profile\u003e\n```\n\n### Java (ie. the Application itself)\n\nHow to do this will depend on the type of application. There are currently 3 major classes of application that can be integrated.\n\n * Command Line Application\n * JavaFX GUI Application\n * Everything else (e.g. SWT application). \n \n** Note, you will find the property `install4j.runtimeDir` useful. In a development environment (e.g. Eclipse), you can set this\nproperty on a launcher to test update functionality. It must be the path to a real installation of the app, suffixed by `.install4j`, e.g.\n`/opt/push-sftp/.install4j`. **\n \n#### Command Line Application\n\nAssuming you are using the `command-utils` module, you will be provide t\n\n#### JavaFX GUI Application\n\nTODO\n\n#### Everything else\n\nTODO\n\n## Install4J Project\n\nThe Install4J project should be setup in the normal way, with the following additions.\n\n 1. Create a *Compiler Variable* named `build.phase`. Give it a default value of `continuous`.\n 1. You will need a launcher that can accept `--jaul-register` or `--jaul-deregister` arguments. You should have a `main()` class that can do this if you followed the above integration instructions. It is usually fine to re-use the launcher for the application, but some circumstances may require a dedicated lancher (e.g. service without a console mode). \n 1. The launcher should also have a *VM Parameter* configured. Add `-Dinstall4j.installationDir=${installer:sys.installationDir}`.  \n 1. In *Screens and Actions* add a new *Run executable or batch file* **Action** at the very *end* of the *Installer*. Have it call the above the launcher, and pass the `--jaul-register` as an argument.\n 1. In *Screens and Actions* add a new *Run executable or batch file* **Action** at the very *start* of the *Uninstaller*. Have it call the above the launcher, and pass the `--jaul-deregister` as an argument.\n 1. In *Screens and Actions* add a new *Application*,  and choose **Standalond update donwloader**.\n 1. Configure this application to have an *Executable Name* of `updater`. Change *Default execution mode* to *Unattended with progress dialog* and the title for the progress dialog to suit your needs.\n 1. Take a note of the *ID* of the Standalone update download (you can turn on showing IDs in the *Project* menubar menu.\n 1. Go to *Auto-Update Options* and add the *URL for updates XML*. This is the final public location where the `updates.xml` will be uploaded to and made available. It will contain the `build.phase  variable. For example, https://sshtools-public.s3.eu-west-1.amazonaws.com/push-sftp-gui/${compiler:build.phase}/updates.xml\n 1. Select *Base URL for installers* and add the same URL, but without the `update.xml` and phase parts on the end, but instead the full version. For example, https://sshtools-public.s3.eu-west-1.amazonaws.com/push-sftp-gui/${compiler:sys,version}/. This URL *must* have a trailing `/`.\n \nSave the project. Now add the ID you noted to the Java application's `@JaulApp` annotation.\n\nYou can now test a build locally.\n\n```\nmvn clean package -DbuildInstaller=true\n```\n\n\n## Jenkins Build  \n\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshtools%2Fjaul","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsshtools%2Fjaul","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshtools%2Fjaul/lists"}