{"id":22650694,"url":"https://github.com/kausalyanp/sample-maven-project","last_synced_at":"2026-04-13T15:31:56.367Z","repository":{"id":262637203,"uuid":"887876550","full_name":"kausalyanp/sample-maven-project","owner":"kausalyanp","description":"Sample Freesyle with Maven Project using Jenkins, Maven 3.6.3, Java in Ubuntu server","archived":false,"fork":false,"pushed_at":"2024-12-14T06:13:50.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T00:35:12.154Z","etag":null,"topics":["aws","cicd","devops","ec2-instance","freestyle","java","jdk","jenkins","maven","maven-plugin","pom","ubunutu"],"latest_commit_sha":null,"homepage":"","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/kausalyanp.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-13T12:45:20.000Z","updated_at":"2025-05-17T12:15:18.000Z","dependencies_parsed_at":"2024-11-13T14:17:54.127Z","dependency_job_id":"ebc2191e-e1b3-46d1-99bc-39c6ec345adf","html_url":"https://github.com/kausalyanp/sample-maven-project","commit_stats":null,"previous_names":["kausalyanp/sample-maven-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kausalyanp/sample-maven-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kausalyanp%2Fsample-maven-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kausalyanp%2Fsample-maven-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kausalyanp%2Fsample-maven-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kausalyanp%2Fsample-maven-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kausalyanp","download_url":"https://codeload.github.com/kausalyanp/sample-maven-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kausalyanp%2Fsample-maven-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31759278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws","cicd","devops","ec2-instance","freestyle","java","jdk","jenkins","maven","maven-plugin","pom","ubunutu"],"created_at":"2024-12-09T08:36:48.545Z","updated_at":"2026-04-13T15:31:56.323Z","avatar_url":"https://github.com/kausalyanp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sample-maven-project\n\nStep 1: Install Jenkins\n```\n#!/bin/bash\nsudo wget -O /usr/share/keyrings/jenkins-keyring.asc \\\n  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key\necho \"deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]\" \\\n  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \\\n  /etc/apt/sources.list.d/jenkins.list \u003e /dev/null\nsudo apt-get update\nsudo apt install fontconfig openjdk-17-jre -y\nsudo apt update\nsudo apt-get install jenkins -y\n\n```\nGo to the Jenkins download page.\nChoose your operating system and follow the specific installation steps.\nStart Jenkins:\n\nAfter installation, start Jenkins:\nLinux: Run \n```\nsudo systemctl start jenkins.\n```\nWindows: Jenkins will typically run as a Windows service after installation.\nAccess Jenkins:\nOpen a web browser and go to http://localhost:8080.\nEnter the initial admin password, which is found in the Jenkins installation directory, to complete the setup.\n\nStep 2: Install Maven\nDownload Maven:\n```\napt install maven\n```\nDownload the latest version of Maven and follow the instructions to install it on your system.\nVerify Installation:\nOpen a terminal (or command prompt) and type:\n```\nmvn -version\n```\nThis should display the Maven version, Java version, and other environment information.\n\nStep 3: Configure Jenkins for Maven\nOpen Jenkins and Configure Tools:\nGo to Manage Jenkins \u003e Global Tool Configuration.\nAdd Maven:\nScroll to the Maven section.\nClick Add Maven and set a name (e.g., Maven3.6).\nIf Maven is not installed on the Jenkins server, you can check the option Install automatically to let Jenkins manage it.\nAdd Java (if not already configured):\nScroll to the JDK section and configure the Java Development Kit (JDK) similarly.\n\nStep 4: Set Up a Sample Maven Project\nTo create a simple Maven project, you need to initialize a Maven project structure and configure necessary files:\nCreate Project Directory:\nOpen a terminal and create a new directory:\n```\nmkdir sample-maven-project\ncd sample-maven-project\n```\nInitialize Maven Project:\nRun the following command to create a basic Maven project structure:\n```\nmvn archetype:generate -DgroupId=com.example -DartifactId=sample-maven-project -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false\nThis command will create the necessary files and folders, including pom.xml (Maven configuration file) and basic Java source files.\n```\nFile Structure:\nAfter running the above command, the file structure should look like this:\n```\nsample-maven-project\n├── pom.xml\n└── src\n    ├── main\n    │   └── java\n    │       └── com\n    │           └── example\n    │               └── App.java\n    └── test\n        └── java\n            └── com\n                └── example\n                    └── AppTest.java\n```\nEdit App.java (optional):\nOpen App.java in a text editor and add a simple main method if it doesn’t have one:\n```\npackage com.example;\n\npublic class App {\n    public static void main(String[] args) {\n        System.out.println(\"Hello, World!\");\n    }\n}\n```\nEdit AppTest.java (optional):\nMake sure AppTest.java includes a simple test:\n```\npackage com.example;\n\nimport static org.junit.Assert.assertTrue;\nimport org.junit.Test;\n\npublic class AppTest {\n    @Test\n    public void shouldAnswerWithTrue() {\n        assertTrue(true);\n    }\n}\n```\n\nStep 5: Upload Project to GitHub\nInitialize Git:\n```\ngit init\ngit add .\ngit commit -m \"Initial commit\"\n```\nCreate a GitHub Repository:\nGo to GitHub, create a new repository, and follow the instructions to push your code:\n```\ngit remote add origin https://github.com/your-username/sample-maven-project.git\ngit push -u origin main\n```\n\nStep 6: Create a Freestyle Project in Jenkins\nCreate a New Project:\nIn Jenkins, click New Item.\nEnter a name for your project (e.g., SampleMavenProject).\nSelect Freestyle project and click OK.\n\nConfigure Source Code Management:\nIn the project configuration page, scroll to Source Code Management and select Git.\nEnter the GitHub repository URL.\nAdd credentials if required (such as a GitHub token).\n\nStep 7: Configure Build with Maven\nAdd a Build Step:\nScroll down to the Build section and click Add Build Step.\nSelect Invoke Top-Level Maven Targets.\nFor Goals, enter clean install (this will clean and compile your project).\nSpecify the POM File:\n\nSample pom.xml file\n```\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\n    \u003c!-- Project metadata --\u003e\n    \u003cgroupId\u003ecom.example\u003c/groupId\u003e\n    \u003cartifactId\u003esample-maven-project\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n    \u003cpackaging\u003ejar\u003c/packaging\u003e\n\n    \u003c!-- Project properties --\u003e\n    \u003cproperties\u003e\n        \u003cmaven.compiler.source\u003e1.8\u003c/maven.compiler.source\u003e\n        \u003cmaven.compiler.target\u003e1.8\u003c/maven.compiler.target\u003e\n        \u003cproject.build.sourceEncoding\u003eUTF-8\u003c/project.build.sourceEncoding\u003e\n    \u003c/properties\u003e\n\n    \u003c!-- Dependencies --\u003e\n    \u003cdependencies\u003e\n        \u003c!-- JUnit for testing --\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ejunit\u003c/groupId\u003e\n            \u003cartifactId\u003ejunit\u003c/artifactId\u003e\n            \u003cversion\u003e4.13.1\u003c/version\u003e\n            \u003cscope\u003etest\u003c/scope\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\n    \u003c!-- Build settings --\u003e\n    \u003cbuild\u003e\n        \u003cplugins\u003e\n            \u003c!-- Compiler plugin --\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                \u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e3.8.1\u003c/version\u003e\n                \u003cconfiguration\u003e\n                    \u003csource\u003e${maven.compiler.source}\u003c/source\u003e\n                    \u003ctarget\u003e${maven.compiler.target}\u003c/target\u003e\n                \u003c/configuration\u003e\n            \u003c/plugin\u003e\n\n            \u003c!-- Surefire plugin for running tests --\u003e\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n                \u003cartifactId\u003emaven-surefire-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e2.22.2\u003c/version\u003e\n            \u003c/plugin\u003e\n        \u003c/plugins\u003e\n    \u003c/build\u003e\n\u003c/project\u003e\n```\n\nIf your pom.xml file is in the root directory, leave this field blank. If it's in a subdirectory, specify the path (e.g., /var/lib/jenkins/workspace/Project-1/sample-maven-project/pom.xml/pom.xml).\n\nStep 8: Save and Build the Project\nSave the Configuration:\nClick Save to save the project configuration.\n\nStep 9: Run the Build:\nOn the project page, click Build Now.\nView the Console Output:\n\nGo to Build History on the left panel, select the build, and click Console Output to view detailed logs of the build process.\n\nNotes:\n1. Use Ubuntu server version Ubuntu Server 22.04 LTS (HVM),EBS General Purpose (SSD)\n2. Storage is 20 GiB (minimum required)\n3. Allow \"All TCP\" traffic in security group inbound rule.\n\n\u003e\u003eCreated By Kausalya N P\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkausalyanp%2Fsample-maven-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkausalyanp%2Fsample-maven-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkausalyanp%2Fsample-maven-project/lists"}