{"id":16101025,"url":"https://github.com/krasa/krasa-jaxb-tools","last_synced_at":"2025-03-16T08:32:27.936Z","repository":{"id":6893779,"uuid":"8143419","full_name":"krasa/krasa-jaxb-tools","owner":"krasa","description":"XJC / JAXB plugin for generation of Bean Validation Annotations (JSR-303) and replacing primitive types","archived":false,"fork":false,"pushed_at":"2022-01-11T12:14:09.000Z","size":188,"stargazers_count":61,"open_issues_count":10,"forks_count":49,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-02-27T05:55:55.757Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krasa.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-11T18:13:03.000Z","updated_at":"2025-01-16T08:20:40.000Z","dependencies_parsed_at":"2022-09-02T11:01:55.535Z","dependency_job_id":null,"html_url":"https://github.com/krasa/krasa-jaxb-tools","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krasa%2Fkrasa-jaxb-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krasa%2Fkrasa-jaxb-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krasa%2Fkrasa-jaxb-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krasa%2Fkrasa-jaxb-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krasa","download_url":"https://codeload.github.com/krasa/krasa-jaxb-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806070,"owners_count":20350775,"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-10-09T18:48:57.407Z","updated_at":"2025-03-16T08:32:27.631Z","avatar_url":"https://github.com/krasa.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/com.github.krasa/krasa-jaxb-tools.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.krasa/krasa-jaxb-tools/)\n\n\u003eNOTE: I no longer use and maintain this plugin. Consider using this fork: https://github.com/fillumina/krasa-jaxb-tools\n\n\nContains:\n----------------\n* plugin for replacing primitives **-XReplacePrimitives** (e.g. int -\u003e Integer)\n* plugin for generation of Bean Validation Annotations (JSR-303) **-XJsr303Annotations**\n\n---- \n\nRelease:\n----------------\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.krasa\u003c/groupId\u003e\n    \u003cartifactId\u003ekrasa-jaxb-tools\u003c/artifactId\u003e\n    \u003cversion\u003e1.8\u003c/version\u003e\n\u003c/dependency\u003e\n```\nVery Old Snapshot:\n----------------\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.krasa\u003c/groupId\u003e\n    \u003cartifactId\u003ekrasa-jaxb-tools\u003c/artifactId\u003e\n    \u003cversion\u003e1.7-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003crepository\u003e\n    \u003cid\u003esnapshots-repo\u003c/id\u003e\n    \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n    \u003creleases\u003e\n        \u003cenabled\u003efalse\u003c/enabled\u003e\n    \u003c/releases\u003e\n    \u003csnapshots\u003e\n        \u003cenabled\u003etrue\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n\u003c/repository\u003e\n```\n\n---- \nXJsr303Annotations\n----------------\nGenerates:\n* @Valid annotation for all complex types, can be further restricted to generate only for types from defined schema: -XJsr303Annotations:targetNamespace=http://www.foo.com/bar\n* @NotNull annotation for objects that has a MinOccur value \u003e= 1 or for attributes with required use\n* @Size for lists that have minOccurs \u003e 1\n* @Size if there is a maxLength or minLength or length restriction\n* @DecimalMax for maxInclusive restriction\n* @DecimalMin for minInclusive restriction\n* @DecimalMax for maxExclusive restriction, enable new parameter (inclusive=false) with: -XJsr303Annotations:JSR_349=true\n* @DecimalMin for minExclusive restriction, enable new parameter (inclusive=false) with: -XJsr303Annotations:JSR_349=true\n* @Digits if there is a totalDigits or fractionDigits restriction.\n* @Pattern if there is a Pattern restriction\n\n\n----------------\n\n@NotNull's default validation message is not always helpful, so it can be customized with **-XJsr303Annotations:notNullAnnotationsCustomMessages=OPTION** where **OPTION** is one of the following:\n* `false` (default: no custom message -- not useful)\n* `true` (message is present but equivalent to the default: **\"{javax.validation.constraints.NotNull.message}\"** -- not useful)\n* `FieldName` (field name is prefixed to the default message: **\"field {javax....message}\"**)\n* `ClassName` (class and field name are prefixed to the default message: **\"Class.field {javax....message}\"**)\n* `other-non-empty-text` (arbitrary message, with substitutable, case-sensitive parameters `{ClassName}` and `{FieldName}`: **\"Class {ClassName} field {FieldName} non-null\"**)\n\n----------------\n\nBean validation policy can be customized with **-XJsr303Annotations:generateServiceValidationAnnotations=OPTION** where **OPTION** is one of the following:\n* `InOut` (default: validate requests and responses)\n* `In` (validate only requests)\n* `Out` (validate only responses)\n\n**Using this option requires to specify krasa as front end generator** (See example below)\n\n---- \nXReplacePrimitives\n----------------\n* replaces primitive types by Objects\n* WARNING: must be defined before XhashCode or Xequals\n\n---- \nExample project with tests:\n----------------\nhttps://github.com/krasa/krasa-jaxb-tools-example\n\n---- \nUsage:\n----------------\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.apache.cxf\u003c/groupId\u003e\n    \u003cartifactId\u003ecxf-codegen-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e${cxf-codegen-plugin.version}\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003ewsdl2java\u003c/id\u003e\n            \u003cphase\u003egenerate-sources\u003c/phase\u003e\n            \u003cconfiguration\u003e\n                \u003cwsdlOptions\u003e\n                    \u003cwsdlOption\u003e\n                        \u003cwsdl\u003esrc/main/resources/wsdl/...\u003c/wsdl\u003e\n                        \u003cextraargs\u003e\n                            ...\n                            \u003cextraarg\u003e-xjc-XJsr303Annotations\u003c/extraarg\u003e\n\t\t\t\t\t\t\t\u003c!--optional--\u003e\n                            \u003cextraarg\u003e-xjc-XJsr303Annotations:targetNamespace=http://www.foo.com/bar\u003c/extraarg\u003e\n                         \t\u003c!--optional, this is default values--\u003e\n                            \u003cextraarg\u003e-xjc-XJsr303Annotations:generateNotNullAnnotations=true\u003c/extraarg\u003e\n                         \t\u003c!--optional, default is false, possible values are true, FieldName, ClassName, or an actual message --\u003e\n                            \u003cextraarg\u003e-xjc-XJsr303Annotations:notNullAnnotationsCustomMessages=false\u003c/extraarg\u003e\n                            \u003cextraarg\u003e-xjc-XJsr303Annotations:JSR_349=false\u003c/extraarg\u003e\n                            \u003cextraarg\u003e-xjc-XJsr303Annotations:verbose=false\u003c/extraarg\u003e\n                            \u003c!--optional, only needed for generateServiceValidationAnnotations, which possible values are InOut (default), In, Out --\u003e\n                            \u003cextraarg\u003e-fe\u003c/extraarg\u003e\n                            \u003cextraarg\u003ekrasa\u003c/extraarg\u003e\n                            \u003cextraarg\u003e-xjc-XJsr303Annotations:generateServiceValidationAnnotations=In\u003c/extraarg\u003e\n                        \u003c/extraargs\u003e\n                    \u003c/wsdlOption\u003e\n                \u003c/wsdlOptions\u003e\n            \u003c/configuration\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003ewsdl2java\u003c/goal\u003e\n            \u003c/goals\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.github.krasa\u003c/groupId\u003e\n            \u003cartifactId\u003ekrasa-jaxb-tools\u003c/artifactId\u003e\n            \u003cversion\u003e${krasa-jaxb-tools.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n        ...\n    \u003c/dependencies\u003e\n\u003c/plugin\u003e\n```\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.jvnet.jaxb2.maven2\u003c/groupId\u003e\n    \u003cartifactId\u003emaven-jaxb2-plugin\u003c/artifactId\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003egenerate\u003c/goal\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cforceRegenerate\u003etrue\u003c/forceRegenerate\u003e\n                \u003cschemas\u003e\n                    \u003cschema\u003e\n                        \u003cfileset\u003e\n                            \u003cdirectory\u003e${basedir}/src/main/resources/wsdl\u003c/directory\u003e\n                            \u003cincludes\u003e\n                                \u003cinclude\u003e*.*\u003c/include\u003e\n                            \u003c/includes\u003e\n                            \u003cexcludes\u003e\n                                \u003cexclude\u003e*.xs\u003c/exclude\u003e\n                            \u003c/excludes\u003e\n                        \u003c/fileset\u003e\n                    \u003c/schema\u003e\n                \u003c/schemas\u003e\n                \u003cextension\u003etrue\u003c/extension\u003e\n                \u003cargs\u003e\n                    \u003carg\u003e-XJsr303Annotations\u003c/arg\u003e\n                \u003c/args\u003e\n                \u003cplugins\u003e\n                    \u003cplugin\u003e\n                        \u003cgroupId\u003ecom.github.krasa\u003c/groupId\u003e\n                        \u003cartifactId\u003ekrasa-jaxb-tools\u003c/artifactId\u003e\n                        \u003cversion\u003e${krasa-jaxb-tools.version}\u003c/version\u003e\n                    \u003c/plugin\u003e\n                \u003c/plugins\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.apache.cxf\u003c/groupId\u003e\n    \u003cartifactId\u003ecxf-xjc-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e2.6.0\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003csourceRoot\u003e${basedir}/src/generated/\u003c/sourceRoot\u003e\n        \u003cxsdOptions\u003e\n            \u003cxsdOption\u003e\n                \u003cextension\u003etrue\u003c/extension\u003e\n                \u003cxsd\u003esrc/main/resources/a.xsd\u003c/xsd\u003e\n                \u003cpackagename\u003efoo\u003c/packagename\u003e\n                \u003cextensionArgs\u003e\n                    \u003cextensionArg\u003e-XJsr303Annotations\u003c/extensionArg\u003e\n                    \u003cextensionArg\u003e-XJsr303Annotations:targetNamespace=http://www.foo.com/bar\u003c/extensionArg\u003e\n                \u003c/extensionArgs\u003e\n            \u003c/xsdOption\u003e\n        \u003c/xsdOptions\u003e\n        \u003cextensions\u003e\n            \u003cextension\u003ecom.github.krasa:krasa-jaxb-tools:${krasa-jaxb-tools.version}\u003c/extension\u003e\n        \u003c/extensions\u003e\n    \u003c/configuration\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003egenerate-sources\u003c/id\u003e\n            \u003cphase\u003egenerate-sources\u003c/phase\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003exsdtojava\u003c/goal\u003e\n            \u003c/goals\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrasa%2Fkrasa-jaxb-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrasa%2Fkrasa-jaxb-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrasa%2Fkrasa-jaxb-tools/lists"}