{"id":19830638,"url":"https://github.com/ansforge/archetype-java","last_synced_at":"2025-02-28T17:25:40.856Z","repository":{"id":104902259,"uuid":"482944445","full_name":"ansforge/archetype-java","owner":"ansforge","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-18T19:48:35.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-11T09:51:31.200Z","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/ansforge.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2022-04-18T17:56:55.000Z","updated_at":"2024-03-31T14:25:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe53e245-75af-4809-b729-c4750426afa4","html_url":"https://github.com/ansforge/archetype-java","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansforge%2Farchetype-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansforge%2Farchetype-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansforge%2Farchetype-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansforge%2Farchetype-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansforge","download_url":"https://codeload.github.com/ansforge/archetype-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241190025,"owners_count":19924951,"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-12T11:24:31.102Z","updated_at":"2025-02-28T17:25:40.838Z","avatar_url":"https://github.com/ansforge.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Spring Framework 5.1 miniservice Maven Archetype\n======================================\n\n# Summary\n\nThe project is a Maven archetype for Spring SOAP/XML REST/JSON application.\n\nIt aims to serve to propose both an API based on REST/JSON and Web Services endpoints SOAP/XML\n\nWeb Services endpoints SOAP/XML are served by Apache CXF framework\nREST/JSON endpoints are served by Spring Framework MVC with Jackson JSON de/serialization\n\nNotes:\nThis archetype may not work with prior versions of Spring Framework 5.0.x, or 4.3.x, and Java \u003c 1.8\nIt uses methods which are not reverse compatible.\n\nWhen Spring Framework 5.2 will be released, this archetype must be upgraded accordingly.\n\nPR contributions are welcome as long as there is no Spring Boot dependency included.\n\n## Generated project characteristics\n* Bill of Material\n* Spring MVC web application, with Java config and no Spring Boot\n* [Apache CXF](http://cxf.apache.org/docs/overview.html) for the SOAP/XML web services endpoints\n* Java Persistence (JPA)\n** [Spring Data JPA](https://spring.io/projects/spring-data)\n** [Hibernate](http://hibernate.org/orm)\n** [HSQLDB](http://hsqldb.org/)\n** [H2](http://www.h2database.com/)\n** [Postgresql](https://www.postgresql.org/)\n* Testing with [JUnit](http://junit.org )/[Mockito](https://github.com/mockito/mockito)\n* Docker containerization with [Google Jib maven plugin](https://github.com/GoogleContainerTools/jib)\n* Cache memory with [Caffeine](https://github.com/ben-manes/caffeine)\n* [Jackson JSON/XML/CSV data-binding functionality](http://github.com/FasterXML/jackson)\n* [Problem, implementation of the application/problem+json draft](https://github.com/zalando/problem)\n* [Lombok](https://projectlombok.org/) to reduce boilerplate code (cf readme of generated project)\n* Unit tests with [JUnit 5 Jupiter](https://junit.org/junit5/) and [Mockito](https://github.com/mockito/mockito)\n\n## TODO\n* \n\n## Prerequisites\n\n- JDK 8 (tested with Java 11)\n- [Apache Maven](https://maven.apache.org/download.cgi) 3.6 (tested with 3.6.0)\n- Not mandatory [Docker](https://docs.docker.com/install/#supported-platforms) \n\n\n# Create a new project with this Maven archetype\n\nBeware: no pom.xml should be in directory where you run following command. For good measure create an empty directory.\n\n## command line\n\nPrerequisites: Java and Maven must be installed.\n\n\nadd to your ~/.m2/settings.xml a new repo in an activated profile\n\n```\n\u003crepositories\u003e\n  ...\n  \u003crepository\u003e\n    \u003csnapshots\u003e\n      \u003cenabled\u003etrue\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n    \u003cid\u003ejitpack.io\u003c/id\u003e\n    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n  \u003c/repository\u003e\n  ...\n\u003crepositories\u003e  \n```\n\nand run interactively in a directory without a pom.xml in it\n\n```bash\n  mvn archetype:generate \\\n      -DarchetypeGroupId=fr.ans \\\n      -DarchetypeArtifactId=archetype-java \\\n      -DarchetypeVersion=0.0.5\n```\n\nor with prior building of this archetype\n\n```bash\nmvn install\ncd ..\nmvn archetype:generate -DarchetypeCatalog=local\n```\n\nIndicate the properties of your generated project :\n\n```bash\ngroupId: fr.ans\nartifactId: archetype-java\nversion: 0.0.1-SNAPSHOT\npackage: fr.ans\nparentArtifactId: bom-ms\nparentGroupId: fr.gipcps.bom\nparentVersion: 2.0.4\npipelineTemplate: AnsPipelineJdk8Mvn33\n Y: :\n ```\n \nType \"N\" to enter your own values, and then type \"Y\" to confirm properties configuration.\n\nNote : Concerning the property piplelineTemplate, only 2 values are allowed depending on your java version and maven version\n\nFor JDK 8 \u0026 Maven 3.3, Enter \"AnsPipelineJdk8Mvn33\"\n\nFor JDK 11 \u0026 Maven 3.6, Enter \"AnsPipelineJdk11Mvn36\"\n\n## IntelliJ\n\n* Create new project `File \u003e New \u003e Project`\n* Click Maven on the left hand side of the new project dialog\n* Check `Create from archetype`\n* Click the `Add Archetype` button\n* Set `Group Id` to `fr.ans`\n* Set `Artifact Id` to `archetype-java`\n* Set `Version` to `0.0.5`\n* Click next and create the project\n\nNote: If you would like to create a project using archetype published in your local repository, skip repository field and make sure it is installed locally (see below).\n\n## Eclipse / Spring Tool Suite\n\n* Create new project `File \u003e New \u003e Maven Project`\n* Make sure `Create a simple project` option is not selected\n* Click `Next` to navigate to `Select an Archetype` screen\n* Make sure `Include snapshot archetypes` is selected\n* Click `Add Archetype` button\n* Set `Archetype Group Id` to `fr.ans`\n* Set `Archetype Artifact Id` to `archetype-java`\n* Set `Archetype Version` to `0.0.5`\n* Click `OK` so the Archetype is added to the list\n* Click `Next` and fill in `Group Id`, `Artifact Id` and `Version` of your new project\n\nNote: Remember to select `Include snapshot archetypes`. \n\n\n## Local repository\n\n### Install archetype locally self build\n\nTo install the archetype in your local repository execute the following commands:\n\n```bash\n  git clone .../archetype-java\n  cd archetype-java\n  mvn clean install\n```\n### Create a project from a local repository\n\nUse a directory without a pom.xml in it and then run:\n\n```bash\n  mvn archetype:generate \\\n      -DarchetypeGroupId=fr.ans \\\n      -DarchetypeArtifactId=archetype-java \\\n      -DarchetypeVersion=0.0.5\n```\n\nNote: The above command will bootstrap a project using the archetype published in your local repository.\n\n# Run the project\n\n## Docker\n\n[Docker](https://docs.docker.com/install/#supported-platforms) must be installed\n\n```bash\n  mvn compile jib:buildTar\n  docker load --input target/*.tar\n  docker run acme:0.0.5-dev\n```\n## Eclipse IDE\n\ncreate a new server goto Preferences -\u003e Server -\u003e Runtime Environments\n\nand add the project just created, publish, start the server\n\n## Tomcat plugin (deprecated)\nNavigate to newly created project directory (`my-artifactId`) and then run:\n\n```bash\n  mvn test tomcat7:run\n```\n\n\u003e Note: It is not recommended to run the artifact, Tomcat Maven Plugin Version 2.2 was released on 2013-11-11\n\n### Test in the browser\n-------------------\n\n  http://localhost:8080/\n\nNote: No additional services are required in order to start the application.\n\n\n\n# Project Configuration \n\n## Switching to PostgreSQL\n\nPrerequisites:\n PostgreSQL up and running, tablespace, and credentials valid\n\n* Build and run with the correct profile:\n\n```bash\nmvn clean package -P-h2,dev,pgsql help:active-profiles\n```\n\n## Switching to H2 database\n\nIt is default DB activated, to change default reset to `\u003cactiveByDefault\u003efalse\u003c/activeByDefault\u003e` in POM\n\n* Build and run with the correct profile:\n\n```bash\nmvn clean package -P dev,h2 help:active-profiles\n```\n\n## Switching to HSQL DB\n\n* Build and run with the correct profile:\n\n```bash\nmvn clean package -P-h2,dev,hsql help:active-profiles\n```\n\n## Switching to MySQL/Maria DB\n\nPrerequisites:\n MySQL up and running, tablespace, and credentials valid\n \n* Build and run with the correct profile:\n\n```bash\nmvn clean package -P-h2,dev,mysql help:active-profiles\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansforge%2Farchetype-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansforge%2Farchetype-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansforge%2Farchetype-java/lists"}