{"id":22707617,"url":"https://github.com/xvik/slush-lib-java","last_synced_at":"2025-10-04T16:43:47.308Z","repository":{"id":19549455,"uuid":"22797962","full_name":"xvik/slush-lib-java","owner":"xvik","description":"Slush generator for java library","archived":false,"fork":false,"pushed_at":"2015-02-01T09:04:05.000Z","size":592,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T09:51:06.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"XSLT","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xvik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-10T00:14:27.000Z","updated_at":"2016-02-02T15:41:20.000Z","dependencies_parsed_at":"2022-08-24T13:40:21.806Z","dependency_job_id":null,"html_url":"https://github.com/xvik/slush-lib-java","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/xvik/slush-lib-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvik%2Fslush-lib-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvik%2Fslush-lib-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvik%2Fslush-lib-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvik%2Fslush-lib-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xvik","download_url":"https://codeload.github.com/xvik/slush-lib-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvik%2Fslush-lib-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278343071,"owners_count":25971399,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-10T10:13:35.759Z","updated_at":"2025-10-04T16:43:47.256Z","avatar_url":"https://github.com/xvik.png","language":"XSLT","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Java library slush generator\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/xvik/slush-lib-java)\n[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://www.opensource.org/licenses/MIT)\n[![NPM version](http://img.shields.io/npm/v/slush-lib-java.svg?style=flat)](http://badge.fury.io/js/slush-lib-java)\n[![Downloads](http://img.shields.io/npm/dm/slush-lib-java.svg?style=flat)](https://www.npmjs.org/package/slush-lib-java)\n\n**Deprecated!**\n\nUse [yeoman generator](https://github.com/xvik/generator-lib-java) instead: [migration guide](https://github.com/xvik/slush-lib-java/wiki)\n\n### About\n\nThe main goal is to simplify new [github](https://github.com) java library setup.\nSimplifies build upgrade (especially if there are many repositories).\n\nFeatures:\n* [MIT](http://opensource.org/licenses/MIT) license (hardcoded)\n* [Gradle](http://www.gradle.org/) build (with support of optional and provided dependencies)\n* [Maven central](http://search.maven.org/) compatible artifacts (jar, sources, javadocs)\n* Ready for [spock](https://code.google.com/p/spock/) tests ([documentation](http://spock-framework.readthedocs.org/en/latest/))\n* [Bintray](https://bintray.com/) publication (+ jars signing and maven central publishing)\n* [Travis-ci](https://travis-ci.org/) integration (CI and healthy badge)\n* [Coveralls](http://coveralls.io/) integration (code coverage badge)\n* Target jdk compatibility check with [animal sniffer](http://mojo.codehaus.org/animal-sniffer/) (project configured for 1.6 compatibility, while you may use any jdk to build)\n* Code quality checks (pmd, checkstyle, findbugs)\n* Release process (like maven release)\n\nNote: checkstyle 6.2 requires jdk7 or above, so if you use quality checks you will have to use jdk7 or above for build.\n \n[The story behind](https://medium.com/@vyarus/faster-way-to-java-opensource-d4fa78efcf16)\n\n### Thanks to\n\n* [Vladislav Bauer](https://github.com/vbauer) ([android-arsenal](http://android-arsenal.com/) author) for checkstyle config and [gitignore.io](https://gitignore.io) hint\n* [Juan Roperto](https://github.com/jroperto) for pmd config\n\n### Setup\n\nInstall [slush](http://slushjs.github.io/):\n\n```bash\n$ npm install -g slush\n```\n\nInstall `slush-lib-java` globally:\n\n```bash\n$ npm install -g slush-lib-java\n```\n\n##### Update\n\nYou can check currently installed generator version using:\n\n```bash\n$ slush --help\n```\n\nIt will print all installed generators with versions\n\nTo update lib use:\n\n```bash\n$ npm update -g slush-lib-java\n```\n\n### Bintray setup\n\nSign up to [bintray](https://bintray.com/).\nYou will need to create maven repository to package artifacts to (it's name is one of generator questions).\n\nWhen you publish you package (release library), you can use it directly from your custom maven repository.\nBetter option is to request inclusion into jcenter repository (maven central alternative).\nAlso, you can publish your library to maven central. Project already generates valid artifacts for maven central, but\nthey also must be signed. If you register certificate on bintray, it will be able to sign files for you.\n\nRead [instruction](https://medium.com/@vyarus/the-hard-way-to-maven-central-c9e16d163acc)\n\nAdd bintray user and key to `~/.gradle/gradle.properties`\n\n```\nbintrayUser=username\nbintrayKey=secretkey\n```\n\nIf you will use automatic maven central publishing add:\n\n```\nsonatypeUser=username\nsonatypePassword=password\n```\n\n### Usage\n\n\u003e General convention: project name == github project name == bintray package page\n\nCreate new folder for library:\n\n```bash\n$ mkdir my-library\n```\n\nRun generator:\n\n```bash\n$ cd my-library \u0026\u0026 slush lib-java\n```\n\nProject setup ready, start coding!\n\n#### Build upgrade\n\nWhen launched on already generated project it works in update mode: in this case\nall changed files replacement will be asked.\nIf java sources directory exist, default package would not be generated.\nAlso some files (like readme, changelog, gradle.properties etc)\nwill not be updated (because they usually should not be updated after generation):\nit reduces number of override confirm questions.\n\nStart it without local changes and after generation look git changes and correct\n(usually only main build.gradle requires modifications after update).\n\nUpdate mode greatly simplifies maintaining single build in many repositories and\nreduce errors possibility (before it it was so easy to forget to update something).\n\n### Generator defaults\n\nSome generator questions most likely will not change between your libraries (author, email, github user, bintray repo).\nYou can specify defaults in `~/.generator` file.\n\nExample:\n```\nlibGroup = maven.group\nlibPackage = my.default.package\nauthorName = My Name\nauthorEmail = my@email.com\nuserName = githubNick\nbintrayUser = bintrayUserName\nlibRepo = bintrayRepoName\nbintraySignFiles = no\nmavenCentralSync = no\nenableQualityChecks = yes\n```\n\nFor boolean properties `yes` is recognized and everything else will be parsed as `no`\n\n### Project usage\n\n```bash\n$ gradlew check\n```\n\nRuns code quality plugins. If quality checks were activated (asked during generation) do check before pushing to avoid \nbuild failures on travis. Moreover, it's easy to always keep everything clean instead of doing it before release.\n\n```bash\n$ gradlew checkOutOfDate\n```\n\nChecks if your project dependencies are actual and prints versions analysis report to console.\n\n```bash\n$ gradlew showDependenciesTree\n```\n\nGenerates dependencies html report and launch it in default browser.\nTo analyze conflicts, click on dependency name to activate \n[dependencyInsight](http://www.gradle.org/docs/current/groovydoc/org/gradle/api/tasks/diagnostics/DependencyInsightReportTask.html) popup.\n\n```bash\n$ gradlew install\n```\n\nInstalls library to local maven repository. Useful for referencing by other projects (for testing without releasing library).\n\n```bash\n$ gradlew release\n```\n\nReleases library. Read release process section below before performing first release.\n\n\n#### Optional dependencies\n\nOptional and provided dependencies could be defined, for example:\n\n```groovy\nprovided 'com.google.code.findbugs:jsr305:3.0.0'\n```\n\nor \n\n```groovy\noptional 'com.google.code.findbugs:jsr305:3.0.0'\n```\n\nIn generated pom these dependencies will be defined as provided or optional, but for gradle build it's\nthe same as declaring them in `compile` scope.\n\njsr305 provided dependency is defined by default in generated project (useful to guide firebug).\n\nScala note: The Scala compiler, unlike the Java compiler, [requires that annotations used by a library be available when \ncompiling against that library](https://issues.scala-lang.org/browse/SI-5420). \nIf your library users will compile with Scala, they must declare a dependency on JSR-305 jar.\n\n### Project details\n\nAll project specific data (mostly inserted with generator) is in `build.gradle` file.\n`project.ext` section contains configuration objects definitions. \nThese definitions are extended using conventions (see `github.gradle`, `bintray.gradle`)\n\nUsed gradle plugins:\n* [java](http://www.gradle.org/docs/current/userguide/java_plugin.html)\n* [groovy](http://www.gradle.org/docs/current/userguide/groovy_plugin.html) to support spock tests\n* [maven-publish](http://www.gradle.org/docs/current/userguide/publishing_maven.html) to generate pom and publish to maven repository\n* [com.jfrog.bintray](https://github.com/bintray/gradle-bintray-plugin) for bintray publishing\n* [com.github.ben-manes.versions](https://github.com/ben-manes/gradle-versions-plugin) to check dependencies versions updates\n* [project-report](http://www.gradle.org/docs/current/userguide/project_reports_plugin.html) to generate dependency tree html report\n* [jacoco](http://www.gradle.org/docs/current/userguide/jacoco_plugin.html) to build coverage report for coveralls\n* [com.github.kt3k.coveralls](https://github.com/kt3k/coveralls-gradle-plugin) to send coverage report to coveralls\n* [pmd](http://www.gradle.org/docs/current/userguide/pmd_plugin.html) to check code quality with [PMD](http://pmd.sourceforge.net/) tool\n* [checkstyle](http://www.gradle.org/docs/current/userguide/checkstyle_plugin.html) to check code style rules with [checkstyle](http://checkstyle.sourceforge.net/index.html)\n* [findbugs](http://www.gradle.org/docs/current/userguide/findbugs_plugin.html) to find potential bugs with [findbugs](http://findbugs.sourceforge.net/)\n* [be.insaneprogramming.gradle.animalsniffer](https://bitbucket.org/lievendoclo/animalsniffer-gradle-plugin) to verify jdk backwards compatibility (1.6) when building on newer jdk (1.7, 1.8)\n* [release](https://github.com/townsfolk/gradle-release) for release (see [article](http://www.sosaywecode.com/gradle-release-plugin/) for additional plugin details)\n\n#### Java compatibility\n\nBy default project configured for java 6 compatibility (see build config section):\n\n```groovy\n    build = {\n        gradle = 2.1\n        java = 1.6\n        signature = 'org.codehaus.mojo.signature:java16-sun:+@signature'\n    }\n```\n\n`java` option defines target and source java compiler options.\n\n`signature` defines [animal sniffer](http://mojo.codehaus.org/animal-sniffer/) signature to check.\nWith it you can use any jdk while developing and if you accidentally use newer api than defined in signature\nit will warn you on compilation. You can find [other signatures in maven central](http://search.maven.org/#search%7Cga%7C2%7Csignature).\nTo switch off animal sniffer check simply set signature value to `''`\n\nKnown issue: sometimes gradle build failed on animal sniffer task with generic error. In this case simply execute gradle clean\nand issue will be resolved (issue occur because of IDE).\n\n#### Travis \n\nTravis configured to automatically set execution flag on `gradlew` shell script.\nIf you still want to set it manually on windows use git (not required anymore):\n\n```bash\n$ git update-index --chmod=+x gradlew\n$ git commit -m \"Changing file permissions\"\n$ git push\n```\n\n### External services\n\nCreate github repo matching your library name and push project there.\n\nIn github project settings go to `Webhooks \u0026 services` and add `travis-ci` service.\n\nGo to [travis](https://travis-ci.org/) and enable your repo.\n\nGo to [coveralls](http://coveralls.io/) and enable your repo.\n\nBintray and maven central badges are generated in readme, but commented (uncomment before release).\n\n### Gitter\n\n[Gitter](https://gitter.im) is a chat room for your repository. Most likely, with it you\nwill get much more feedback (something people will never post as issue or write by email).\n\nGitter badge is not generated automatically, because it's not required as other services and it's too easy to add at any time.\nLook it and decide if you need it.\n\nNOTE: gitter badge contains space: `..badges.gitter.im/Join Chat.svg`. It's ok for github, but bintray\nwill not handle it. To fix it replace space: `..badges.gitter.im/Join%20Chat.svg`\n\n### Quality tools\n\n#### Checkstyle\n\nBy default, checkstyle configured with simplified checks file. Modify it according to your needs.\n[Sun conventions](http://java.sun.com/docs/codeconv/) file is also provided as reference\n(see `gradle/config/checkstyle/sun_checks.xml`). You can replace default file in `quality.gradle`.\n\nTo suppress checkstyle warnings (required for some exceptional cases) use `@SuppressWarnings` annotation with \nvalue composed as `checkstyle:` prefix and lowercased checkstyle check name:\n\n```java\n@SuppressWarnings(\"checkstyle:classdataabstractioncoupling\")\n```\n\nTo suppress all checkstyle checks in class comments syntax could be used before class:\n\n```java\n// CHECKSTYLE:OFF\n```\n\nAlso, use checkstyle plugin for your IDE (for example, CheckStyle-IDEA for idea) and set your checkstyle configuration\nfor plugin. This way you will see issues quicker and will have to do less cleanups before commit (where you will call\nquality checks).\n\n\n#### PMD\n\nTo suppress PMD violation use (in case PMD makes a mistake):\n\n```java\n@SuppressWarnings(\"PMD.checkName\")\n```\n\nTo suppress all PMD checks in class:\n\n```java\n@SuppressWarnings(\"PMD\")\n```\n\nPmd configuration file: `gradle/config/pmd/pmd.xml`\n\n#### Findbugs\n\nTo suppress findbugs warnings you can use [exclusion filter](http://findbugs.sourceforge.net/manual/filter.html) (gradle/config/findbugs/exclude.xml).\nFindbug does not support @SuppressWarnings, instead you can use it's own [@SuppressFBWarnings](http://findbugs.sourceforge.net/api/edu/umd/cs/findbugs/annotations/SuppressFBWarnings.html)\n(but you will have to add dependency for annotations `'com.google.code.findbugs:annotations:3.0.0'`)\n\nYou may face issue with guava functions or predicates:\n\n```\ninput must be nonnull but is marked as nullable [NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE]\n```\n\nThe reason for this is that guava use `@Nullable` annotation, which is `@Inherited`, so\neven if you not set annotation on your own function or predicate it will still be visible,\n\nThe simplest workaround is to set `@Nonnull` annotaion (from jsr305 jar included by default) on your function or predicate:\n\n```java\npublic boolean apply(@Nonnull final Object input) {\n```\n\nAlso, it's good idea to use jsr305 annotations to guide findbugs.\n\n### Release process\n\n#### First release\n\nThe following steps must be performed only before first library release.\n\nDue to [known issue](https://github.com/bintray/gradle-bintray-plugin/issues/30) in bintray plugin, first upload will fail if package not yet exist.\nSo either create package manually or call:\n\n```bash\n$ gradlew bintrayUpload\n```\nTo create package on bintray (it will fail but it's ok - package should be created).\n\nCurrent bintray rest api did not allow to link github readme and changelog file automatically.\nSo you will have to go to your package page and edit package: fill in github repository name (user/repo-name) and\nthe name of changes file (CHANGELOG.md). After that click on 'readme' tab on package page and select 'github page'.\nDo the same on 'release notes' tab.\n\nAfter actual release press 'add to jcenter' button to request jcenter linking (required for maven central publication \nand even if you dont want to sync to maven central, linking to jcenter will simplify library usage for end users)\n\nWhen releasing first time it's better to do \n\n```bash\n$ gradlew install \n```\n\nAnd validate generated pom file and jars (in local maven repository ~/.m2/repository/..).\n\nNOTE: Release plugin requires access to git repository without credentials, so it's \nbetter to allow storing credentials when using git console.\nWindows users with sysgit 1.8.1 and up could use: \n\n```bash\n$ git config --global credential.helper wincred\n```\n\nTo [avoid problems](https://github.com/townsfolk/gradle-release/issues/81).\n\nBintray and maven central badges are commented in readme - uncomment them (remove maven badge if not going to publish there)\n\n\n#### General release process\n\nUpdate `CHANGELOG.md`.\n\nPush all changes before release and wait for `travis` to check build (wait for green badge).\n\nPerform release:\n\n```bash\n$ gradlew release\n```\n \nRelease will check that current copy is actual: no uncommitted/unversioned/unpushed changes, nothing newer is in remote repository.\nYou can start releasing either from snapshot version (1.0.0-SNAPSHOT) or from normal one (1.0.0).\n\nDuring release, plugin will create tag (new github release appear) and update version in `gradle.properties`.\n\nNOTE: Sometimes release plugin [did not set 'SNAPSHOT' postfix](https://github.com/townsfolk/gradle-release/issues/64) to new version.\n\nMaven synchronization may be triggered during release. If you didn't configure it, you may still use bintray ui for synchronization.\nUsually synchronization works well, but sometimes it fails with strange errors (something like not able to close repository) -\nsimply do sync one more time (eventually it will do it (of course, if your files valid))\n\n#### If release failed\n\nNothing bad could happen. \n\nIf bintray upload failed, you can always upload one more time.\nIf you uploaded bad version and want to re-release it, simply remove version files on bintray package version page and re-do release.\n\nIf release failed, but plugin already commit new version - you can release again from this state (no need to revert).\n\nRelease plugin changes only version in `gradle.properties` and creates git tag. \nVersion could be reverted manually (by correcting file) and git tag could be also removed like this:\n\n```bash\ngit tag -d release01 \ngit push origin :refs/tags/release01 \n```\n\n### Support\n\n[Gitter chat room](https://gitter.im/xvik/slush-lib-java)\n\n### Examples\n\n* [guice-persist-orient](https://github.com/xvik/guice-persist-orient)\n* [guice-ext-annotations](https://github.com/xvik/guice-ext-annotations)\n* [guice-validator](https://github.com/xvik/guice-validator)\n* [dropwizard-orient-server](https://github.com/xvik/dropwizard-orient-server)\n* [dropwizard-guicey](https://github.com/xvik/dropwizard-guicey)\n* [generics-resolver](https://github.com/xvik/generics-resolver)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvik%2Fslush-lib-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxvik%2Fslush-lib-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvik%2Fslush-lib-java/lists"}