diff --git a/IndustrialTrainingProjects/README.MD b/IndustrialTrainingProjects/README.MD index 6dc324e..d844076 100644 --- a/IndustrialTrainingProjects/README.MD +++ b/IndustrialTrainingProjects/README.MD @@ -25,4 +25,5 @@ if the problem still persist then create a issue or use Google/Stack Overlflow f |2 | [PrivateConSingleton.java](https://github.com/psavarmattas/Java-Projects/blob/master/IndustrialTrainingProjects/PrivateConSingleton.java) | Program to implement private constructor using the Singleton method. | |3 | [EmployeeModelClass.java](https://github.com/psavarmattas/Java-Projects/blob/master/IndustrialTrainingProjects/EmployeeModelClass.java) | Program to create Model Class, Getters, Setters and display the data. | |4 | [TwoDimensionalArraySum.java](https://github.com/psavarmattas/Java-Projects/blob/master/IndustrialTrainingProjects/TwoDimensionalArraySum.java) | Program to sum 2 two dimensional arrays forming a matrix. | -|5 | [CompoundInterestCalculator.java](https://github.com/psavarmattas/Java-Projects/blob/master/IndustrialTrainingProjects/CompoundInterestCalculator.java) | Program to calculate compound interest for the provided principle amount & time by following certain criteria. | \ No newline at end of file +|5 | [CompoundInterestCalculator.java](https://github.com/psavarmattas/Java-Projects/blob/master/IndustrialTrainingProjects/CompoundInterestCalculator.java) | Program to calculate compound interest for the provided principle amount & time by following certain criteria. | +|6 | [testAppMaven](https://github.com/psavarmattas/Java-Projects/blob/master/IndustrialTrainingProjects/testAppMaven) | Program to understand maven configs with Spring Boot Framework. | \ No newline at end of file diff --git a/IndustrialTrainingProjects/testAppMaven/.idea/.gitignore b/IndustrialTrainingProjects/testAppMaven/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/IndustrialTrainingProjects/testAppMaven/.idea/compiler.xml b/IndustrialTrainingProjects/testAppMaven/.idea/compiler.xml new file mode 100644 index 0000000..5e94358 --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IndustrialTrainingProjects/testAppMaven/.idea/encodings.xml b/IndustrialTrainingProjects/testAppMaven/.idea/encodings.xml new file mode 100644 index 0000000..63e9001 --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/IndustrialTrainingProjects/testAppMaven/.idea/jarRepositories.xml b/IndustrialTrainingProjects/testAppMaven/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/IndustrialTrainingProjects/testAppMaven/.idea/misc.xml b/IndustrialTrainingProjects/testAppMaven/.idea/misc.xml new file mode 100644 index 0000000..868de31 --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/.idea/misc.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/IndustrialTrainingProjects/testAppMaven/pom.xml b/IndustrialTrainingProjects/testAppMaven/pom.xml new file mode 100644 index 0000000..065c3cd --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + + org.example + testAppMaven + 1.0-SNAPSHOT + + + 11 + 11 + + + + org.springframework.boot + spring-boot-starter-parent + 2.7.0 + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${project.parent.version} + + + + + + + org.springframework + spring-context + 5.3.20 + + + + \ No newline at end of file diff --git a/IndustrialTrainingProjects/testAppMaven/src/main/java/demo/Main.java b/IndustrialTrainingProjects/testAppMaven/src/main/java/demo/Main.java new file mode 100644 index 0000000..aa68fa4 --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/src/main/java/demo/Main.java @@ -0,0 +1,14 @@ +package demo; + +import org.springframework.context.support.AbstractApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +public class Main { + public static void main(String[] args) { + // Getting application context and configuring class path of the xml file + AbstractApplicationContext context = new ClassPathXmlApplicationContext("spring.xml"); + student st = context.getBean(student.class); // Spring get bean method + st.studyJava(); // Calling the method studyJava from student class + System.out.println(student.getName()); // Using get name method to print the value of variable name + } +} \ No newline at end of file diff --git a/IndustrialTrainingProjects/testAppMaven/src/main/java/demo/student.java b/IndustrialTrainingProjects/testAppMaven/src/main/java/demo/student.java new file mode 100644 index 0000000..57dc72c --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/src/main/java/demo/student.java @@ -0,0 +1,27 @@ +package demo; + +import org.springframework.stereotype.Component; + +@Component //Annotation in Spring Boot +public class student { + + private static String name; // Name variable to use constructor, getter & setters + + public static String getName() { // Get Method to get the value of variable name + return name; + } + + public void setName(String name) { // Set Method to set the value of variable name + student.name = name; + } + +// Constructor method with old config in spring.xml +// public student(String name) { +// student.name = name; +// System.out.println(name); +// } + + public void studyJava(){ // Random method created to check the working of this class + System.out.println("Student is studying java"); + } +} diff --git a/IndustrialTrainingProjects/testAppMaven/src/main/resources/spring.xml b/IndustrialTrainingProjects/testAppMaven/src/main/resources/spring.xml new file mode 100644 index 0000000..e6daebc --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/src/main/resources/spring.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/IndustrialTrainingProjects/testAppMaven/target/classes/demo/Main.class b/IndustrialTrainingProjects/testAppMaven/target/classes/demo/Main.class new file mode 100644 index 0000000..8790885 Binary files /dev/null and b/IndustrialTrainingProjects/testAppMaven/target/classes/demo/Main.class differ diff --git a/IndustrialTrainingProjects/testAppMaven/target/classes/demo/student.class b/IndustrialTrainingProjects/testAppMaven/target/classes/demo/student.class new file mode 100644 index 0000000..1935edd Binary files /dev/null and b/IndustrialTrainingProjects/testAppMaven/target/classes/demo/student.class differ diff --git a/IndustrialTrainingProjects/testAppMaven/target/classes/spring.xml b/IndustrialTrainingProjects/testAppMaven/target/classes/spring.xml new file mode 100644 index 0000000..e6daebc --- /dev/null +++ b/IndustrialTrainingProjects/testAppMaven/target/classes/spring.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + +