{"id":50967168,"url":"https://github.com/ucoruh/eclipse-java-maven-template","last_synced_at":"2026-06-18T21:32:32.049Z","repository":{"id":169213593,"uuid":"644882316","full_name":"ucoruh/eclipse-java-maven-template","owner":"ucoruh","description":"Maven (Build,Test,Coverage,Publish) + Doxygen (HTML, Latex, RTF) + ReportGenerator + QA (Test Coverage) + Astyle Template","archived":false,"fork":false,"pushed_at":"2024-12-19T23:25:57.000Z","size":2016,"stargazers_count":2,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-20T00:25:27.823Z","etag":null,"topics":["ce100","ce103","ce204","ce205","homework-assignments","programming-course","rteu-ceng"],"latest_commit_sha":null,"homepage":"https://ucoruh.github.io/eclipse-java-maven-template/","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucoruh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-05-24T13:00:47.000Z","updated_at":"2024-12-19T23:26:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"41c698a2-0f0c-441d-8fdc-6e56b38827cf","html_url":"https://github.com/ucoruh/eclipse-java-maven-template","commit_stats":null,"previous_names":["ucoruh/eclipse-java-maven-template"],"tags_count":22,"template":true,"template_full_name":null,"purl":"pkg:github/ucoruh/eclipse-java-maven-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucoruh%2Feclipse-java-maven-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucoruh%2Feclipse-java-maven-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucoruh%2Feclipse-java-maven-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucoruh%2Feclipse-java-maven-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucoruh","download_url":"https://codeload.github.com/ucoruh/eclipse-java-maven-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucoruh%2Feclipse-java-maven-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34508864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["ce100","ce103","ce204","ce205","homework-assignments","programming-course","rteu-ceng"],"created_at":"2026-06-18T21:32:30.966Z","updated_at":"2026-06-18T21:32:32.032Z","avatar_url":"https://github.com/ucoruh.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eclipse-java-maven-template\n\n# Overview\n\nYou will generate eclipse maven project with Junit4 from CLI and. Also you will generate jar and then you will run your application. For more information you can check examples [Maven – Maven in 5 Minutes](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html) and [TheNEXUS | A Community Project](https://books.sonatype.com/mvnref-book/reference/index.html)\n\n## Releases\n\n- [![GitHub release badge](https://badgen.net/github/release/ucoruh/eclipse-java-maven-template)](https://github.com/ucoruh/eclipse-java-maven-template/releases/latest)\n\n## Platforms\n\n- ![Ubuntu badge](assets/badge-ubuntu.svg)\n\n- ![macOS badge](assets/badge-macos.svg)\n\n- ![Windows badge](assets/badge-windows.svg)\n\n## Test Coverage\n\n[![Release](https://github.com/ucoruh/eclipse-java-maven-template/actions/workflows/release.yml/badge.svg)](https://github.com/ucoruh/eclipse-java-maven-template/actions/workflows/release.yml)\n\n**Coverage**\n\n- ![All](assets/badge_combined.svg)\n\n**Branch Coverage**\n\n- ![Branch Coverage](assets/badge_branchcoverage.svg)\n\n**Line Coverage**\n\n- ![Line Coverage](assets/badge_linecoverage.svg)\n\n**Method Coverage**\n\n- ![Method Coverage](assets/badge_methodcoverage.svg)\n\n### Install Requirements\n\n- Eclipse\n  \n  - [Eclipse Downloads | The Eclipse Foundation](https://www.eclipse.org/downloads/)\n\n- Maven\n  \n  - [Maven – Download Apache Maven](https://maven.apache.org/download.cgi)\n\n- JDK\n  \n  - [Eclipse Downloads | The Eclipse Foundation](https://www.eclipse.org/downloads/)\n\n- Lcov\n  \n  - https://fredgrott.medium.com/lcov-on-windows-7c58dda07080\n\n- Coverxygen\n  \n  - [coverxygen · PyPI](https://pypi.org/project/coverxygen/)\n  \n  - [GitHub - psycofdj/coverxygen: Generate doxygen\u0026#39;s documentation coverage report](https://github.com/psycofdj/coverxygen)\n\n- Reportgenerator\n  \n  - https://reportgenerator.io/\n\n```bash\ndotnet tool install -g dotnet-reportgenerator-globaltool\n```\n\n- Choose Licence\n  \n  - [Appendix | Choose a License](https://choosealicense.com/appendix/)\n\n#### Package Manager Windows Setup\n\nWe will install required application with package manager on Windows so use following script to install [chocolatey](https://chocolatey.org/install) and [scoop](https://scoop.sh/)\n\n```batch\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\n\necho Checking if Chocolatey is installed...\nif exist \"%ProgramData%\\Chocolatey\\bin\\choco.exe\" (\n    echo Chocolatey is already installed.\n) else (\n    echo Installing Chocolatey...\n    powershell -Command \"Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))\"\n)\n\necho Checking if Scoop is installed...\nwhere scoop \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo Scoop is already installed.\n) else (\n    echo Scoop is not installed. Installing Scoop...\n    powershell Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')\n    powershell Set-ExecutionPolicy RemoteSigned -scope CurrentUser\n)\n\npause\n```\n\n### Pre-Commit Code Formatter Astyle Installation\n\nBefore each commit also with batch script we will format our code with astyle we need to install it with package manager as following script you can visit package manager web site for more details [Chocolatey Software | Artistic Style 3.2.1](https://community.chocolatey.org/packages/astyle) and [https://astyle.sourceforge.net/](https://astyle.sourceforge.net/)\n\n```batch\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\necho Installing Astyle...\nchoco install astyle\n```\n\nAstyle tool need configuration there is example configuration named `astyle-options.txt`\n\n```yaml\n# https://github.com/brchiu/openairinterface5g/blob/master/ci-scripts/astyle-options.txt\n# OAI is using a style that is similar to the Google style\n--style=google\n# long options can be written without the preceding '--'\n# Convert tabs to spaces\nconvert-tabs\n# Indentation is 2 spaces\nindent=spaces=2\n# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block. \nindent-switches\n# Indent preprocessor blocks at bracket level 0.\nindent-preproc-block\n# Indent multi-line preprocessor #define statements.\nindent-preproc-define\n# Indent C++ comments beginning in column one.\nindent-col1-comments\n# Pad empty lines around header blocks\nbreak-blocks\ndelete-empty-lines\n# Attach a pointer or reference operator (*, \u0026, or ^) to the variable name (right)\nalign-pointer=name\n# The code line length is 200 characters/columns (this is the maximum allowed by astyle)\nmax-code-length=200\n# If the line contains logical conditionals they will be placed first on the new line.\nbreak-after-logical\n# Force use of the linux end of line\n# lineend=linux\n```\n\nAfter installation and config file generation we can format our code with following script this script look for .cs extension and format related files according to configuration in astyle-options.txt\n\n```batch\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\n\necho Formatting Code with Astyle...\n\nastyle --options=\"astyle-options.txt\" --recursive *.cs\n\npause\n```\n\n### Doxygen and Graphviz Setup + MkDocs Material Theme\n\nWe will use package manager for this but also we can use several tools I prefer to use following script to install all parties, This setup also use for mkdocs material them documentation generation maybe we can use for project website generation\n\n```batch\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\n\nrem force re-install need \"--force --force-dependencies -y\" parameters\n\nREM Test if Pandoc is installed\nwhere pandoc \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo Pandoc is already installed.\n) else (\n    echo Installing Pandoc...\n    choco install pandoc -y\n)\n\nREM Test if rsvg-convert is installed\nwhere rsvg-convert \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo rsvg-convert is already installed.\n) else (\n    echo Installing rsvg-convert...\n    choco install rsvg-convert -y\n)\n\nREM Test if Python is installed\nwhere python \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo Python is already installed.\n) else (\n    echo Installing Python...\n    choco install python -y\n)\n\n\nREM Test if Miktex is installed\nwhere miktex \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo Miktex is already installed.\n) else (\n    echo Installing Miktex...\n    choco install miktex -y\n)\n\nREM Test if CuRL is installed\nwhere curl \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo curl is already installed.\n) else (\n    echo Installing CuRL...\n    choco install curl -y\n)\n\nREM Test if MARP-CLI is installed\nwhere marp \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo MARP-CLI is already installed.\n) else (\n    echo Installing MARP-CLI...\n    choco install marp-cli -y\n)\n\nREM Test if Doxygen is installed\nwhere doxygen \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo MARP-CLI is already installed.\n) else (\n    echo Installing Doxygen...\n    choco install doxygen.install -y\n)\n\nREM Test if Doxygen is installed\nwhere dot \u003enul 2\u003e\u00261\nif %errorlevel%==0 (\n    echo Graphviz is already installed.\n) else (\n    echo Installing Graphviz...\n    choco install graphviz -y\n)\n\npip install mkdocs\npip install pymdown-extensions\npip install mkdocs-material\npip install mkdocs-material-extensions\npip install mkdocs-simple-hooks\npip install mkdocs-video\npip install mkdocs-minify-plugin\npip install mkdocs-git-revision-date-localized-plugin\npip install mkdocs-minify-plugin\npip install mkdocs-static-i18n\npip install mkdocs-with-pdf\npip install qrcode\npip install mkdocs-awesome-pages-plugin\npip install mkdocs-embed-external-markdown\npip install mkdocs-include-markdown-plugin\npip install mkdocs-ezlinks-plugin\npip install mkdocs-git-authors-plugin\npip install mkdocs-git-committers-plugin\npip install mkdocs-exclude\n\npip install pptx2md\npause\n```\n\nAfter doxygen installation create default doxygen file with -g option\n\n```batch\ndoxygen -g\n```\n\nThis will create Doxyfile for us to modify. Use Doxywizard to modify file. Be sure that your output directory should be **./docs** and all warnings should be opened and warnings stop operations.\n\n# \n\n#### coverxygen Setup\n\nWe are parsing doxygen XML output with coverxygen and generate info file for LCOV. This tool generate output that LCOV use and generate HTML document coverage report\n\nTo install coverxygen you need python and pip\n\n```bash\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\necho Installing converxygen doxygen XML parser\npip install coverxygen\n```\n\n#### LCOV Setup\n\nLCOV is use to generate HTML document coverage tool in this project, but it can be used for different purposes. You can use choco package manager to install application as follow\n\n```bash\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\necho Installing Report Generator...\nchoco install lcov -y\necho lcov and genhtml located on C:\\ProgramData\\chocolatey\\lib\\lcov\\tools\\bin\\\npause\n```\n\n#### ReportGenerator Setup\n\nWe need to install [reportgenerator](https://reportgenerator.io/) for creation of HTML test reports, we will use choco to install visit package manager web site [Chocolatey Software | ReportGenerator (Portable) - Generates reports for various code coverage tools 5.1.20](https://community.chocolatey.org/packages/reportgenerator.portable)\n\n```batch\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\necho Installing Report Generator...\nchoco install reportgenerator.portable\n```\n\n## Repository Setup\n\n#### Github Repositoy Creation\n\nFirst create a empty project in github and clone it to your PC,\n\n#### Pre-Commit Action Restrictions\n\nUse following pre-commit script and replace it with `.git/hook/precommit`\n\n```bash\n#!/bin/bash\n# Installation:\n#   Copy this script as pre-commit to .git/hooks folder\n\nOPTIONS=\"--options=astyle-options.txt\"\n\n# Check if .gitignore file exists\nif [ ! -f astyle-options.txt ]; then\n    echo \"[!] astyle-options.txt file not found. Please make sure the astyle-options.txt file is present.\" \u003e\u00262\n    exit 1\nfi\n\nRETURN=0\nASTYLE=$(command -v astyle)\nif [ $? -ne 0 ]; then\n    echo \"[!] AStyle is not installed. Unable to check source file format policy.\" \u003e\u00262\n    exit 1\nfi\n\n# Check if .gitignore file exists\nif [ ! -f .gitignore ]; then\n    echo \"[!] .gitignore file not found. Please make sure the .gitignore file is present.\" \u003e\u00262\n    exit 1\nfi\n\n# Check if README.md file exists\nif [ ! -f README.md ]; then\n    echo \"[!] README.md file not found. Please make sure the README.md file is present.\" \u003e\u00262\n    exit 1\nfi\n\n# Check if .gitignore file exists\nif [ ! -f Doxyfile ]; then\n    echo \"[!] Doxyfile file not found. Please make sure the Doxyfile file is present.\" \u003e\u00262\n    exit 1\nfi\n\nFILES=$(git diff --cached --name-only --diff-filter=ACMRTUXB | grep -E \"\\.(cs|java|c|cpp|h)$\")\nfor FILE in $FILES; do\n    FORMATTED=$( \"$ASTYLE\" $OPTIONS \u003c \"$FILE\" 2\u003e\u00261 )\n    if [ $? -ne 0 ]; then\n        echo \"[!] Error formatting $FILE:\" \u003e\u00262\n        echo \"$FORMATTED\" \u003e\u00262\n        RETURN=1\n    elif [ -n \"$FORMATTED\" ]; then\n        echo \"Formatted $FILE\"\n        echo \"$FORMATTED\"\n        echo \"\"\n        echo \"$FORMATTED\" \u003e \"$FILE\"\n        git add \"$FILE\"\n    fi\ndone\n\nif [ $RETURN -eq 1 ]; then\n    echo \"\" \u003e\u00262\n    echo \"Make sure you have run AStyle with the following options:\" \u003e\u00262\n    echo $OPTIONS \u003e\u00262\nfi\n\nexit $RETURN\n```\n\nThis script will check astyle-options.txt file, gitignore file, README.md file and Doxyfile is exist if not it will be terminate your commit operation. Also after `astyle` installation and `astyle-options.txt` generation it will automatically format your source code before each commit. Formatting configuration will be stored in `astyle-options.txt` .\n\n#### Create .gitignore with TOPTAL API via batch script\n\nUse the following script to generate .gitignore file, you can change gitignore file by changing the configuration after `https://www.toptal.com/developers/gitignore/api`\n\nThis is the selected configuration\n\n`c,csharp,vs,visualstudio,visualstudiocode,java,maven,c++,cmake,eclipse,netbeans`\n\n```batch\n@echo off\n\nset API_URL=https://www.toptal.com/developers/gitignore/api/c,csharp,vs,visualstudio,visualstudiocode,java,maven,c++,cmake,eclipse,netbeans\nset OUTPUT_FILE=.gitignore\n\nREM Set the running folder to the current working folder\ncd /d \"%~dp0\"\n\nREM Download the API results using curl\ncurl -s -o %OUTPUT_FILE% %API_URL%\n\necho Downloaded .gitignore file from %API_URL% and saved as %OUTPUT_FILE%\n\npause\n```\n\n#### Create an Empty README.md file\n\nCreate and EMPTY `README.md` file and during project fill required parts\n\n#### Create Default Doxyfile\n\nUse following command to generate default `Doxyfile` if you didn't create or you can use pre-configured configuration and you can edit over this configurations. Be sure that your output directory should be **./docs** and all warnings should be opened and warnings stop operations.\n\n```batch\ndoxygen -g\n```\n\n#### First commit is ready, You can commit and push your work.\n\nYou can use gitextension to commit your work, check if you get any error than return steps and check missing parts.\n\n---\n\n## Creating a Project\n\n```bash\nmvn archetype:generate -DgroupId=com.ucoruh.calculator -DartifactId=calculator-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false\n```\n\n### Import Project to Eclipse\n\nUse import existing maven project option to import project to Eclipse\n\n### Rename Files\n\nRename App.java to CalculatorApp.java and AppTest.java to CalculatorAppTest.java and Generate Calculator.java and CalculatorTest.java\n\n```java\npackage com.ucoruh.calculator;\n\nimport org.slf4j.LoggerFactory;\n\nimport ch.qos.logback.classic.Logger;\n\npublic class Calculator {\n\n    private static final Logger logger = (Logger) LoggerFactory.getLogger(Calculator.class);\n\n    /**\n     * \n     * @param a\n     * @param b\n     * @return\n     */\n    public int add(int a, int b) {\n\n        logger.info(\"Logging message\");\n\n        logger.error(\"Error message\");\n\n        return a + b;\n    }\n}\n```\n\n```java\npackage com.ucoruh.calculator;\n\nimport java.io.IOException;\n\nimport org.slf4j.LoggerFactory;\n\nimport ch.qos.logback.classic.Logger;\n\n/**\n * Hello world!\n *\n */\npublic class CalculatorApp {\n\n    private static final Logger logger = (Logger) LoggerFactory.getLogger(CalculatorApp.class);\n\n    public static void main(String[] args) {\n\n        logger.info(\"Logging message\");\n\n        logger.error(\"Error message\");\n\n        System.out.println(\"Hello World!\");\n\n        try {\n\n            if(args.length\u003e0)\n            {\n                if(args[0].equals(\"1\"))\n                {\n                    throw new IOException(\"Dummy Exception...\");\n                }\n            }\n\n            System.out.println(\"Press Enter to Continue...\");\n\n            System.in.read();\n\n            System.out.println(\"Thank you...\");\n\n        } catch (IOException e) {\n            logger.error(e.toString());\n            e.printStackTrace();\n        }\n    }\n}\n```\n\nGenerate test with add new unit test feature in Eclipse \n\n![](assets/2023-05-24-16-48-59-image.png)\n\n![](assets/2023-05-24-16-49-11-image.png)\n\n![](assets/2023-05-24-16-49-27-image.png)\n\n```java\n/**\n * \n */\npackage com.ucoruh.calculator;\n\nimport static org.junit.Assert.*;\n\nimport org.junit.After;\nimport org.junit.AfterClass;\nimport org.junit.Before;\nimport org.junit.BeforeClass;\nimport org.junit.Test;\n\n/**\n * @author ugur.coruh\n *\n */\npublic class CalculatorTest {\n\n    /**\n     * @throws java.lang.Exception\n     */\n    @BeforeClass\n    public static void setUpBeforeClass() throws Exception {\n    }\n\n    /**\n     * @throws java.lang.Exception\n     */\n    @AfterClass\n    public static void tearDownAfterClass() throws Exception {\n    }\n\n    /**\n     * @throws java.lang.Exception\n     */\n    @Before\n    public void setUp() throws Exception {\n    }\n\n    /**\n     * @throws java.lang.Exception\n     */\n    @After\n    public void tearDown() throws Exception {\n    }\n\n    @Test\n    public void testAddition() {\n        Calculator calculator = new Calculator();\n        int result = calculator.add(2, 3);\n        assertEquals(5, result);\n    }\n\n}\n```\n\n```java\npackage com.ucoruh.calculator;\n\nimport static org.junit.Assert.*;\n\nimport java.io.InputStream;\nimport java.io.PrintStream;\nimport java.io.ByteArrayInputStream;\nimport java.io.ByteArrayOutputStream;\n\nimport org.junit.After;\nimport org.junit.AfterClass;\nimport org.junit.Before;\nimport org.junit.BeforeClass;\nimport org.junit.Test;\n\npublic class CalculatorAppTest {\n\n    @BeforeClass\n    public static void setUpBeforeClass() throws Exception {\n    }\n\n    @AfterClass\n    public static void tearDownAfterClass() throws Exception {\n    }\n\n    @Before\n    public void setUp() throws Exception {\n    }\n\n    @After\n    public void tearDown() throws Exception {\n    }\n\n\n    @Test\n    public void testMainSuccess() {\n        // Redirect System.in and System.out\n        InputStream originalIn = System.in;\n        PrintStream originalOut = System.out;\n\n        // Create a ByteArrayInputStream with the desired input\n        String input = System.lineSeparator(); // Pressing \"Enter\" key\n        ByteArrayInputStream inputStream = new ByteArrayInputStream(input.getBytes());\n\n        // Redirect System.in to the ByteArrayInputStream\n        System.setIn(inputStream);\n\n        // Create a ByteArrayOutputStream to capture the output\n        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n        System.setOut(new PrintStream(outputStream));\n\n        String[] args = new String[] {\"0\"};\n        // Call the main method of CalculatorApp\n        CalculatorApp.main(args);\n\n        // Restore original System.in and System.out\n        System.setIn(originalIn);\n        System.setOut(originalOut);\n\n        // Assert the desired behavior based on the output\n        assertTrue(true);\n    }\n\n    @Test\n    public void testMainError() {\n        // Redirect System.in and System.out\n        InputStream originalIn = System.in;\n        PrintStream originalOut = System.out;\n\n        // Create a ByteArrayInputStream with the desired input\n        String input = System.lineSeparator(); // Pressing \"Enter\" key\n        ByteArrayInputStream inputStream = new ByteArrayInputStream(input.getBytes());\n\n        // Redirect System.in to the ByteArrayInputStream\n        System.setIn(inputStream);\n\n        // Create a ByteArrayOutputStream to capture the output\n        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n        System.setOut(new PrintStream(outputStream));\n\n        String[] args = new String[] {\"1\"};\n        // Call the main method of CalculatorApp\n        CalculatorApp.main(args);\n\n        // Restore original System.in and System.out\n        System.setIn(originalIn);\n        System.setOut(originalOut);\n\n        // Assert the desired behavior based on the output\n        assertTrue(true);\n    }\n\n}\n```\n\n### Update pom.xml\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\n\u003cproject xmlns=\"http://maven.apache.org/POM/4.0.0\"\n    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n    xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\"\u003e\n    \u003cmodelVersion\u003e4.0.0\u003c/modelVersion\u003e\n    \u003c!-- The Basics --\u003e\n    \u003cgroupId\u003ecom.ucoruh.calculator\u003c/groupId\u003e\n    \u003cartifactId\u003ecalculator-app\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n    \u003cpackaging\u003ejar\u003c/packaging\u003e\n\n    \u003c!-- More Project Information --\u003e\n    \u003cname\u003ecalculator-app\u003c/name\u003e\n    \u003curl\u003ehttps://github.com/ucoruh/eclipse-java-maven-template\u003c/url\u003e\n    \u003cscm\u003e\n        \u003curl\u003ehttps://github.com/ucoruh/eclipse-java-maven-template\u003c/url\u003e\n    \u003c/scm\u003e\n    \u003cinceptionYear\u003e2023\u003c/inceptionYear\u003e\n    \u003cdevelopers\u003e\n        \u003cdeveloper\u003e\n            \u003cname\u003eAsst. Prof. Dr. Ugur CORUH\u003c/name\u003e\n            \u003corganization\u003eRTEU\u003c/organization\u003e\n            \u003cemail\u003eugur.coruh@erdogan.edu.tr\u003c/email\u003e\n            \u003croles\u003e\n                \u003crole\u003eDeveloper\u003c/role\u003e\n                \u003crole\u003eDesigner\u003c/role\u003e\n            \u003c/roles\u003e\n        \u003c/developer\u003e\n        \u003cdeveloper\u003e\n            \u003cname\u003eOther Person\u003c/name\u003e\n            \u003corganization\u003eRTEU\u003c/organization\u003e\n            \u003cemail\u003email@gmail.com\u003c/email\u003e\n            \u003croles\u003e\n                \u003crole\u003eDeveloper\u003c/role\u003e\n            \u003c/roles\u003e\n        \u003c/developer\u003e\n    \u003c/developers\u003e\n    \u003ccontributors\u003e\n        \u003ccontributor\u003e\n            \u003cname\u003eAsst. Prof. Dr. Ugur CORUH\u003c/name\u003e\n            \u003cemail\u003eugur.coruh@erdogan.edu.tr\u003c/email\u003e\n            \u003corganization\u003eRTEU\u003c/organization\u003e\n            \u003croles\u003e\n                \u003crole\u003eDeveloper\u003c/role\u003e\n                \u003crole\u003eDesigner\u003c/role\u003e\n            \u003c/roles\u003e\n        \u003c/contributor\u003e\n        \u003ccontributor\u003e\n            \u003cname\u003eOther Person\u003c/name\u003e\n            \u003corganization\u003eRTEU\u003c/organization\u003e\n            \u003cemail\u003email@gmail.com\u003c/email\u003e\n            \u003croles\u003e\n                \u003crole\u003eDeveloper\u003c/role\u003e\n            \u003c/roles\u003e\n        \u003c/contributor\u003e\n    \u003c/contributors\u003e\n    \u003cdescription\u003eMaven Example Template Project\u003c/description\u003e\n    \u003corganization\u003e\n        \u003cname\u003eRecep Tayyip Erdogan University\u003c/name\u003e\n        \u003curl\u003ewww.erdogan.edu.tr\u003c/url\u003e\n    \u003c/organization\u003e\n    \u003c!-- Environment Settings --\u003e\n    \u003cissueManagement\u003e\n        \u003csystem\u003eGithub\u003c/system\u003e\n        \u003curl\u003ehttps://github.com/ucoruh/eclipse-java-maven-template\u003c/url\u003e\n    \u003c/issueManagement\u003e\n    \u003cciManagement\u003e\n        \u003csystem\u003eGithub\u003c/system\u003e\n        \u003cnotifiers\u003e\n            \u003cnotifier\u003e\n                \u003caddress\u003eugur.coruh@erdogan.edu.tr\u003c/address\u003e\n                \u003csendOnSuccess\u003etrue\u003c/sendOnSuccess\u003e\n                \u003csendOnError\u003etrue\u003c/sendOnError\u003e\n                \u003csendOnFailure\u003etrue\u003c/sendOnFailure\u003e\n                \u003csendOnWarning\u003etrue\u003c/sendOnWarning\u003e\n            \u003c/notifier\u003e\n        \u003c/notifiers\u003e\n        \u003curl\u003ehttps://github.com/ucoruh/eclipse-java-maven-template\u003c/url\u003e\n    \u003c/ciManagement\u003e\n    \u003crepositories\u003e\n        \u003crepository\u003e\n            \u003cid\u003eeclipse-java-maven-template\u003c/id\u003e\n            \u003cname\u003eeclipse-java-maven-template\u003c/name\u003e\n            \u003curl\u003ehttps://github.com/ucoruh/eclipse-java-maven-template\u003c/url\u003e\n        \u003c/repository\u003e\n    \u003c/repositories\u003e\n    \u003cdistributionManagement\u003e\n        \u003csite\u003e\n            \u003cname\u003ehttps://github.com/ucoruh/eclipse-java-maven-template\u003c/name\u003e\n            \u003cid\u003eeclipse-java-maven-template\u003c/id\u003e\n        \u003c/site\u003e\n        \u003cdownloadUrl\u003ehttps://github.com/ucoruh/eclipse-java-maven-template\u003c/downloadUrl\u003e\n        \u003crepository\u003e\n            \u003cid\u003eeclipse-java-maven-template\u003c/id\u003e\n            \u003cname\u003eeclipse-java-maven-template\u003c/name\u003e\n            \u003curl\u003ehttps://github.com/ucoruh/eclipse-java-maven-template\u003c/url\u003e\n        \u003c/repository\u003e\n    \u003c/distributionManagement\u003e\n    \u003cproperties\u003e\n        \u003cproject.build.sourceEncoding\u003eUTF-8\u003c/project.build.sourceEncoding\u003e\n        \u003cmaven.compiler.source\u003e1.8\u003c/maven.compiler.source\u003e\n        \u003cmaven.compiler.target\u003e1.8\u003c/maven.compiler.target\u003e\n    \u003c/properties\u003e\n\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ejunit\u003c/groupId\u003e\n            \u003cartifactId\u003ejunit\u003c/artifactId\u003e\n            \u003cversion\u003e4.11\u003c/version\u003e\n            \u003cscope\u003etest\u003c/scope\u003e\n        \u003c/dependency\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.hamcrest\u003c/groupId\u003e\n            \u003cartifactId\u003ehamcrest-all\u003c/artifactId\u003e\n            \u003cversion\u003e1.3\u003c/version\u003e\n            \u003cscope\u003etest\u003c/scope\u003e\n        \u003c/dependency\u003e\n        \u003c!-- SLF4J API --\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.slf4j\u003c/groupId\u003e\n            \u003cartifactId\u003eslf4j-api\u003c/artifactId\u003e\n            \u003cversion\u003e1.7.32\u003c/version\u003e\n        \u003c/dependency\u003e\n        \u003c!-- Logback Implementation --\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ech.qos.logback\u003c/groupId\u003e\n            \u003cartifactId\u003elogback-classic\u003c/artifactId\u003e\n            \u003cversion\u003e1.2.6\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\n    \u003cbuild\u003e\n        \u003cplugins\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n                \u003cconfiguration\u003e\n                    \u003csource\u003e1.8\u003c/source\u003e\n                    \u003ctarget\u003e1.8\u003c/target\u003e\n                \u003c/configuration\u003e\n            \u003c/plugin\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                \u003cartifactId\u003emaven-surefire-plugin\u003c/artifactId\u003e\n                \u003cconfiguration\u003e\n                    \u003cincludes\u003e\n                        \u003cinclude\u003e**/CalculatorAppTest.java\u003c/include\u003e\n                        \u003cinclude\u003e**/CalculatorTest.java\u003c/include\u003e\n                    \u003c/includes\u003e\n                \u003c/configuration\u003e\n            \u003c/plugin\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.jacoco\u003c/groupId\u003e\n                \u003cartifactId\u003ejacoco-maven-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e0.8.7\u003c/version\u003e\n                \u003cexecutions\u003e\n                    \u003cexecution\u003e\n                        \u003cgoals\u003e\n                            \u003cgoal\u003eprepare-agent\u003c/goal\u003e\n                        \u003c/goals\u003e\n                    \u003c/execution\u003e\n                    \u003cexecution\u003e\n                        \u003cid\u003ereport\u003c/id\u003e\n                        \u003cphase\u003etest\u003c/phase\u003e\n                        \u003cgoals\u003e\n                            \u003cgoal\u003ereport\u003c/goal\u003e\n                        \u003c/goals\u003e\n                    \u003c/execution\u003e\n                \u003c/executions\u003e\n            \u003c/plugin\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                \u003cartifactId\u003emaven-site-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e4.0.0-M8\u003c/version\u003e\n                \u003cconfiguration\u003e\n                    \u003cport\u003e9000\u003c/port\u003e\n                    \u003ctempWebappDirectory\u003e${basedir}/target/site\u003c/tempWebappDirectory\u003e\n                \u003c/configuration\u003e\n            \u003c/plugin\u003e\n            \u003c!-- Maven Shade Plugin --\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                \u003cartifactId\u003emaven-shade-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e3.2.4\u003c/version\u003e\n                \u003cexecutions\u003e\n                    \u003cexecution\u003e\n                        \u003cphase\u003epackage\u003c/phase\u003e\n                        \u003cgoals\u003e\n                            \u003cgoal\u003eshade\u003c/goal\u003e\n                        \u003c/goals\u003e\n                        \u003cconfiguration\u003e\n                            \u003ccreateDependencyReducedPom\u003efalse\u003c/createDependencyReducedPom\u003e\n                            \u003ctransformers\u003e\n                                \u003ctransformer\n                                    implementation=\"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer\"\u003e\n                                    \u003cmainClass\u003e\n                                        com.ucoruh.calculator.CalculatorApp\u003c/mainClass\u003e\n                                \u003c/transformer\u003e\n                            \u003c/transformers\u003e\n                        \u003c/configuration\u003e\n                    \u003c/execution\u003e\n                \u003c/executions\u003e\n            \u003c/plugin\u003e\n        \u003c/plugins\u003e\n\n        \u003cpluginManagement\u003e\u003c!-- lock down plugins versions to avoid using Maven\n            defaults (may be moved to parent pom) --\u003e\n            \u003cplugins\u003e\n                \u003c!-- clean lifecycle, see\n                https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-clean-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e3.1.0\u003c/version\u003e\n                \u003c/plugin\u003e\n                \u003c!-- default lifecycle, jar packaging: see\n                https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-resources-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e3.0.2\u003c/version\u003e\n                \u003c/plugin\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e3.8.0\u003c/version\u003e\n                \u003c/plugin\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-surefire-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e2.22.1\u003c/version\u003e\n                \u003c/plugin\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-jar-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e3.0.2\u003c/version\u003e\n                \u003c/plugin\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-install-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e2.5.2\u003c/version\u003e\n                \u003c/plugin\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-deploy-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e2.8.2\u003c/version\u003e\n                \u003c/plugin\u003e\n                \u003c!-- site lifecycle, see\n                https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-site-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e3.7.1\u003c/version\u003e\n                \u003c/plugin\u003e\n                \u003cplugin\u003e\n                    \u003cartifactId\u003emaven-project-info-reports-plugin\u003c/artifactId\u003e\n                    \u003cversion\u003e3.0.0\u003c/version\u003e\n                \u003c/plugin\u003e\n            \u003c/plugins\u003e\n        \u003c/pluginManagement\u003e\n    \u003c/build\u003e\n\u003c/project\u003e\n```\n\n### Generate Project Site Files\n\n- site.xml\n  \n  - resources\n    \n    - images\n      \n      - banner.png\n      \n      - logo.png\n    \n    - markdown\n      \n      - overview.md\n\nYou can use files in project\n\n### Build the Project\n\nEnter pom.xml root folder and run following command to test and generate jar file\n\n```bash\nmvn clean test site package\n```\n\n### Run Project\n\nYou can run application by specify the Main function\n\n```bash\njava -cp calculator-app-1.0-SNAPSHOT.jar com.ucoruh.calculator.CalculatorApp\n```\n\nOutput\n\n```bash\nC:\\Users\\ugur.coruh\\Desktop\\eclipse-java-maven-template\\calculator-app\\target\u003ejava -cp calculator-app-1.0-SNAPSHOT.jar com.ucoruh.calculator.CalculatorApp\nHello World!\n```\n\n### Generate HTML Coverage Report\n\n```bash\nreportgenerator \"-reports:target/site/jacoco/jacoco.xml\" \"-sourcedirs:src/main/java\" \"-targetdir:coveragereport\" -reporttypes:Html\n```\n\nOutput\n\n```bash\nC:\\Users\\ugur.coruh\\Desktop\\eclipse-java-maven-template\\calculator-app\u003ereportgenerator \"-reports:target/site/jacoco/jacoco.xml\" \"-sourcedirs:src/main/java\" \"-targetdir:coveragereport\" -reporttypes:Html\n2023-05-24T17:26:40: Arguments\n2023-05-24T17:26:40:  -reports:target/site/jacoco/jacoco.xml\n2023-05-24T17:26:40:  -sourcedirs:src/main/java\n2023-05-24T17:26:40:  -targetdir:coveragereport\n2023-05-24T17:26:40:  -reporttypes:Html\n2023-05-24T17:26:40: Writing report file 'coveragereport\\index.html'\n2023-05-24T17:26:40: Report generation took 0,2 seconds\n\nC:\\Users\\ugur.coruh\\Desktop\\eclipse-java-maven-template\\calculator-app\u003e\n```\n\n![](assets/2023-05-25-00-52-27-image.png)\n\n## Run Maven Site\n\n```bash\nmvn site:run\n```\n\nUse CTRL+C to cancel from console\n\n![](assets/2023-05-25-03-53-48-image.png)\n\nThis has code coverage and documentation coverage reports also\n\n![](assets/2023-05-25-03-54-34-image.png)\n\n![](assets/2023-05-25-03-54-20-image.png)\n\n![](assets/2023-05-25-03-53-14-image.png)\n\n### Clone-Test-Generate WebSite-Package-Generate Report-Run Web Site\n\n```bash\n@echo off\n\necho Enable necessary extensions\n@setlocal enableextensions\n\necho Change the current working directory to the script directory\n@cd /d \"%~dp0\"\n\ngit clone https://github.com/ucoruh/eclipse-java-maven-template.git\n\necho Get the current directory\nset \"currentDir=%CD%\"\n\necho Change directory to calculator-app\ncd calculator-app\n\necho Perform Maven clean, test, site generation, and packaging\ncall mvn clean test site package\n\necho Return to the previous directory\ncd ..\n\necho Generate Doxygen HTML and XML Documentation\ncall doxygen Doxyfile\n\necho Change directory to calculator-app\ncd calculator-app\n\necho Generate ReportGenerator HTML Report\ncall reportgenerator \"-reports:target/site/jacoco/jacoco.xml\" \"-sourcedirs:src/main/java\" \"-targetdir:target/site/coveragereport\" -reporttypes:Html\n\necho Display information about the binary file\necho Our Binary is a Single Jar With Dependencies. You Do Not Need to Compress It.\n\necho Return to the previous directory\ncd ..\n\necho Generate Doxygen Coverage Report\n\necho Create coverxygen directory\ncd calculator-app\ncd target\ncd site\nmkdir coverxygen\ncd ..\ncd ..\ncd ..\n\necho Run Coverxygen\ncall python -m coverxygen --xml-dir ./calculator-app/target/site/doxygen/xml --src-dir ./ --format lcov --output ./calculator-app/target/site/coverxygen/lcov.info --prefix %currentDir%\\calculator-app\\\n\necho Run lcov genhtml\ncall perl C:\\ProgramData\\chocolatey\\lib\\lcov\\tools\\bin\\genhtml ./calculator-app\\target\\site\\coverxygen\\lcov.info -o calculator-app/target/site/coverxygen\n\necho Package Coverage Report-1\ncall tar -czvf test-jacoco-report.tar.gz -C calculator-app/target/site/jacoco .\n\necho Package Coverage Report-2\ncall tar -czvf test-coverage-report.tar.gz -C calculator-app/target/site/coveragereport .\n\necho Package Code Documentation\ncall tar -czvf application-documentation.tar.gz -C calculator-app/target/site/doxygen .\n\necho Package Product Site\ncall tar -czvf application-site.tar.gz -C target/site .\n\necho Return to the previous directory\ncd ..\n\necho Operation Completed!\npause\n```\n\n### Run Web Site\n\n```bash\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\n\ncd calculator-app\n\necho Run Web Site\necho to Exit Use CTRL+Z CTRL+C\nstart http://localhost:9000/\nmvn site:run\n\necho Operation Completed!\npause\n```\n\n### Run Jar File\n\n```bash\n@echo off\n@setlocal enableextensions\n@cd /d \"%~dp0\"\n\necho Running Application\njava -jar calculator-app/target/calculator-app-1.0-SNAPSHOT.jar\n\necho Operation Completed!\npause\n```\n\n![](assets/2023-05-25-00-57-01-image.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucoruh%2Feclipse-java-maven-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucoruh%2Feclipse-java-maven-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucoruh%2Feclipse-java-maven-template/lists"}