From f898fe9730d879c47b323d3d4a2fdf11cdeb6973 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 1 Jun 2018 02:13:18 +0300 Subject: [PATCH] remove extra dependencies and files (#4384) * remove extra dependencies and files * remove extra file --- spring-boot-ops/pom.xml | 35 +++++-------------- .../baeldung/toggle/EmployeeRepository.java | 7 ---- .../baeldung/toggle/FeatureAssociation.java | 12 ------- .../com/baeldung/toggle/FeaturesAspect.java | 26 -------------- .../java/com/baeldung/toggle/MyFeatures.java | 23 ------------ .../com/baeldung/toggle/SalaryController.java | 20 ----------- .../com/baeldung/toggle/SalaryService.java | 19 ---------- .../baeldung/toggle/ToggleApplication.java | 15 -------- .../baeldung/toggle/ToggleConfiguration.java | 20 ----------- .../converter/StringToEmployeeConverter.java | 2 +- .../StringToEmployeeConverterController.java | 2 +- .../baeldung/boot/domain}/Employee.java | 2 +- .../main/resources/templates/customer.html | 16 --------- .../main/resources/templates/customers.html | 33 ----------------- .../resources/templates/displayallbeans.html | 10 ------ .../main/resources/templates/error-404.html | 14 -------- .../main/resources/templates/error-500.html | 16 --------- .../src/main/resources/templates/error.html | 16 --------- .../main/resources/templates/error/404.html | 8 ----- .../main/resources/templates/external.html | 31 ---------------- .../resources/templates/international.html | 20 ----------- .../src/main/resources/templates/layout.html | 18 ---------- .../src/main/resources/templates/other.html | 16 --------- .../src/main/resources/templates/utils.html | 23 ------------ .../src/test/resources/application.properties | 2 -- 25 files changed, 11 insertions(+), 395 deletions(-) delete mode 100644 spring-boot-ops/src/main/java/com/baeldung/toggle/EmployeeRepository.java delete mode 100644 spring-boot-ops/src/main/java/com/baeldung/toggle/FeatureAssociation.java delete mode 100644 spring-boot-ops/src/main/java/com/baeldung/toggle/FeaturesAspect.java delete mode 100644 spring-boot-ops/src/main/java/com/baeldung/toggle/MyFeatures.java delete mode 100644 spring-boot-ops/src/main/java/com/baeldung/toggle/SalaryController.java delete mode 100644 spring-boot-ops/src/main/java/com/baeldung/toggle/SalaryService.java delete mode 100644 spring-boot-ops/src/main/java/com/baeldung/toggle/ToggleApplication.java delete mode 100644 spring-boot-ops/src/main/java/com/baeldung/toggle/ToggleConfiguration.java rename spring-boot-ops/src/main/java/{com/baeldung/toggle => org/baeldung/boot/domain}/Employee.java (94%) delete mode 100644 spring-boot-ops/src/main/resources/templates/customer.html delete mode 100644 spring-boot-ops/src/main/resources/templates/customers.html delete mode 100644 spring-boot-ops/src/main/resources/templates/displayallbeans.html delete mode 100644 spring-boot-ops/src/main/resources/templates/error-404.html delete mode 100644 spring-boot-ops/src/main/resources/templates/error-500.html delete mode 100644 spring-boot-ops/src/main/resources/templates/error.html delete mode 100644 spring-boot-ops/src/main/resources/templates/error/404.html delete mode 100644 spring-boot-ops/src/main/resources/templates/external.html delete mode 100644 spring-boot-ops/src/main/resources/templates/international.html delete mode 100644 spring-boot-ops/src/main/resources/templates/layout.html delete mode 100644 spring-boot-ops/src/main/resources/templates/other.html delete mode 100644 spring-boot-ops/src/main/resources/templates/utils.html diff --git a/spring-boot-ops/pom.xml b/spring-boot-ops/pom.xml index 760442d386..b6adb27fb2 100644 --- a/spring-boot-ops/pom.xml +++ b/spring-boot-ops/pom.xml @@ -11,16 +11,16 @@ spring-boot-ops Demo project for Spring Boot - - org.springframework.boot - spring-boot-starter-parent - 2.0.1.RELEASE - - + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + - org.baeldung.demo.DemoApplication + org.baeldung.boot.Application UTF-8 UTF-8 1.8 @@ -56,7 +56,7 @@ org.springframework.boot - spring-boot-starter-tomcat + spring-boot-starter-thymeleaf provided @@ -76,12 +76,6 @@ spring-boot-starter-mail - - com.graphql-java - graphql-spring-boot-starter - 3.6.0 - - org.springframework.boot spring-boot-starter-actuator @@ -99,12 +93,6 @@ 2.2 - - org.togglz - togglz-spring-boot-starter - 2.4.1.Final - - com.google.guava guava @@ -130,12 +118,6 @@ ${jquery.version} - - com.graphql-java - graphql-java-tools - 3.2.0 - - @@ -149,7 +131,6 @@ org.springframework.boot spring-boot-maven-plugin - 1.5.2.RELEASE diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/EmployeeRepository.java b/spring-boot-ops/src/main/java/com/baeldung/toggle/EmployeeRepository.java deleted file mode 100644 index 4e75fc6411..0000000000 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/EmployeeRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.baeldung.toggle; - -import org.springframework.data.repository.CrudRepository; - -public interface EmployeeRepository extends CrudRepository { - -} diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/FeatureAssociation.java b/spring-boot-ops/src/main/java/com/baeldung/toggle/FeatureAssociation.java deleted file mode 100644 index 4578b8498e..0000000000 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/FeatureAssociation.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.baeldung.toggle; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.METHOD, ElementType.TYPE }) -public @interface FeatureAssociation { - MyFeatures value(); -} diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/FeaturesAspect.java b/spring-boot-ops/src/main/java/com/baeldung/toggle/FeaturesAspect.java deleted file mode 100644 index 04c6305780..0000000000 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/FeaturesAspect.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.baeldung.toggle; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.stereotype.Component; - -@Aspect -@Component -public class FeaturesAspect { - - private static final Logger LOG = LogManager.getLogger(FeaturesAspect.class); - - @Around(value = "@within(featureAssociation) || @annotation(featureAssociation)") - public Object checkAspect(ProceedingJoinPoint joinPoint, FeatureAssociation featureAssociation) throws Throwable { - if (featureAssociation.value().isActive()) { - return joinPoint.proceed(); - } else { - LOG.info("Feature " + featureAssociation.value().name() + " is not enabled!"); - return null; - } - } - -} diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/MyFeatures.java b/spring-boot-ops/src/main/java/com/baeldung/toggle/MyFeatures.java deleted file mode 100644 index a88ec2166e..0000000000 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/MyFeatures.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.baeldung.toggle; - -import org.togglz.core.Feature; -import org.togglz.core.activation.SystemPropertyActivationStrategy; -import org.togglz.core.annotation.ActivationParameter; -import org.togglz.core.annotation.DefaultActivationStrategy; -import org.togglz.core.annotation.EnabledByDefault; -import org.togglz.core.annotation.Label; -import org.togglz.core.context.FeatureContext; - -public enum MyFeatures implements Feature { - - @Label("Employee Management Feature") - @EnabledByDefault - @DefaultActivationStrategy(id = SystemPropertyActivationStrategy.ID, parameters = { @ActivationParameter(name = SystemPropertyActivationStrategy.PARAM_PROPERTY_NAME, value = "employee.feature"), - @ActivationParameter(name = SystemPropertyActivationStrategy.PARAM_PROPERTY_VALUE, value = "true") }) - EMPLOYEE_MANAGEMENT_FEATURE; - - public boolean isActive() { - return FeatureContext.getFeatureManager().isActive(this); - } - -} diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/SalaryController.java b/spring-boot-ops/src/main/java/com/baeldung/toggle/SalaryController.java deleted file mode 100644 index 5d72f0105a..0000000000 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/SalaryController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung.toggle; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -public class SalaryController { - - @Autowired - SalaryService salaryService; - - @PostMapping(value = "/increaseSalary") - @ResponseBody - public void increaseSalary(@RequestParam long id) { - salaryService.increaseSalary(id); - } -} diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/SalaryService.java b/spring-boot-ops/src/main/java/com/baeldung/toggle/SalaryService.java deleted file mode 100644 index 48a1ddf8d8..0000000000 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/SalaryService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.toggle; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class SalaryService { - - @Autowired - EmployeeRepository employeeRepository; - - @FeatureAssociation(value = MyFeatures.EMPLOYEE_MANAGEMENT_FEATURE) - public void increaseSalary(long id) { - Employee employee = employeeRepository.findById(id).orElse(null); - employee.setSalary(employee.getSalary() + employee.getSalary() * 0.1); - employeeRepository.save(employee); - } - -} diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/ToggleApplication.java b/spring-boot-ops/src/main/java/com/baeldung/toggle/ToggleApplication.java deleted file mode 100644 index 27be6b7cca..0000000000 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/ToggleApplication.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.baeldung.toggle; - -import javax.annotation.security.RolesAllowed; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class ToggleApplication { - @RolesAllowed("*") - public static void main(String[] args) { - System.setProperty("security.basic.enabled", "false"); - SpringApplication.run(ToggleApplication.class, args); - } -} diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/ToggleConfiguration.java b/spring-boot-ops/src/main/java/com/baeldung/toggle/ToggleConfiguration.java deleted file mode 100644 index ee0b251479..0000000000 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/ToggleConfiguration.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.baeldung.toggle; - -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; -import org.togglz.core.manager.EnumBasedFeatureProvider; -import org.togglz.core.spi.FeatureProvider; - -@Configuration -@EnableJpaRepositories("com.baeldung.toggle") -@EntityScan("com.baeldung.toggle") -public class ToggleConfiguration { - - @Bean - public FeatureProvider featureProvider() { - return new EnumBasedFeatureProvider(MyFeatures.class); - } - -} diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java index b07e11e01a..e00d0ad312 100644 --- a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/StringToEmployeeConverter.java @@ -1,6 +1,6 @@ package org.baeldung.boot.converter; -import com.baeldung.toggle.Employee; +import org.baeldung.boot.domain.Employee; import org.springframework.core.convert.converter.Converter; public class StringToEmployeeConverter implements Converter { diff --git a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java index a6e0400845..762d237156 100644 --- a/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/converter/controller/StringToEmployeeConverterController.java @@ -1,6 +1,6 @@ package org.baeldung.boot.converter.controller; -import com.baeldung.toggle.Employee; +import org.baeldung.boot.domain.Employee; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/spring-boot-ops/src/main/java/com/baeldung/toggle/Employee.java b/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Employee.java similarity index 94% rename from spring-boot-ops/src/main/java/com/baeldung/toggle/Employee.java rename to spring-boot-ops/src/main/java/org/baeldung/boot/domain/Employee.java index 64a8b3ce5b..8242e53200 100644 --- a/spring-boot-ops/src/main/java/com/baeldung/toggle/Employee.java +++ b/spring-boot-ops/src/main/java/org/baeldung/boot/domain/Employee.java @@ -1,4 +1,4 @@ -package com.baeldung.toggle; +package org.baeldung.boot.domain; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/spring-boot-ops/src/main/resources/templates/customer.html b/spring-boot-ops/src/main/resources/templates/customer.html deleted file mode 100644 index c8f5a25d5e..0000000000 --- a/spring-boot-ops/src/main/resources/templates/customer.html +++ /dev/null @@ -1,16 +0,0 @@ - - - -Customer Page - - - -
-
-Contact Info:
- -
-

-
- - \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/templates/customers.html b/spring-boot-ops/src/main/resources/templates/customers.html deleted file mode 100644 index 5a060d31da..0000000000 --- a/spring-boot-ops/src/main/resources/templates/customers.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - -
-

- Hello, --name--. -

- - - - - - - - - - - - - - - - - -
IDNameAddressService Rendered
Text ...Text ...Text ...Text...
- -
- - - diff --git a/spring-boot-ops/src/main/resources/templates/displayallbeans.html b/spring-boot-ops/src/main/resources/templates/displayallbeans.html deleted file mode 100644 index 5fc78a7fca..0000000000 --- a/spring-boot-ops/src/main/resources/templates/displayallbeans.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Baeldung - - -

-

- - diff --git a/spring-boot-ops/src/main/resources/templates/error-404.html b/spring-boot-ops/src/main/resources/templates/error-404.html deleted file mode 100644 index cf68032596..0000000000 --- a/spring-boot-ops/src/main/resources/templates/error-404.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -
-
-

Sorry, we couldn't find the page you were looking for.

-

Go Home

-
- - \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/templates/error-500.html b/spring-boot-ops/src/main/resources/templates/error-500.html deleted file mode 100644 index 5ddf458229..0000000000 --- a/spring-boot-ops/src/main/resources/templates/error-500.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - -
-
-

Sorry, something went wrong!

- -

We're fixing it.

-

Go Home

-
- - \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/templates/error.html b/spring-boot-ops/src/main/resources/templates/error.html deleted file mode 100644 index bc517913b2..0000000000 --- a/spring-boot-ops/src/main/resources/templates/error.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - -
-
-

Something went wrong!

- -

Our Engineers are on it.

-

Go Home

-
- - diff --git a/spring-boot-ops/src/main/resources/templates/error/404.html b/spring-boot-ops/src/main/resources/templates/error/404.html deleted file mode 100644 index df83ce219b..0000000000 --- a/spring-boot-ops/src/main/resources/templates/error/404.html +++ /dev/null @@ -1,8 +0,0 @@ - - - RESOURCE NOT FOUND - - -

404 RESOURCE NOT FOUND

- - \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/templates/external.html b/spring-boot-ops/src/main/resources/templates/external.html deleted file mode 100644 index 2f9cc76961..0000000000 --- a/spring-boot-ops/src/main/resources/templates/external.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - -
-
-

Customer Portal

-
-
-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam - erat lectus, vehicula feugiat ultricies at, tempus sed ante. Cras - arcu erat, lobortis vitae quam et, mollis pharetra odio. Nullam sit - amet congue ipsum. Nunc dapibus odio ut ligula venenatis porta non - id dui. Duis nec tempor tellus. Suspendisse id blandit ligula, sit - amet varius mauris. Nulla eu eros pharetra, tristique dui quis, - vehicula libero. Aenean a neque sit amet tellus porttitor rutrum nec - at leo.

- -

Existing Customers

-
- Enter the intranet: customers -
-
- -
- - - - diff --git a/spring-boot-ops/src/main/resources/templates/international.html b/spring-boot-ops/src/main/resources/templates/international.html deleted file mode 100644 index e0cfb5143b..0000000000 --- a/spring-boot-ops/src/main/resources/templates/international.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - -Home - - - - -

- -

-: - - - \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/templates/layout.html b/spring-boot-ops/src/main/resources/templates/layout.html deleted file mode 100644 index bab0c2982b..0000000000 --- a/spring-boot-ops/src/main/resources/templates/layout.html +++ /dev/null @@ -1,18 +0,0 @@ - - - -Customer Portal - - - - - \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/templates/other.html b/spring-boot-ops/src/main/resources/templates/other.html deleted file mode 100644 index d13373f9fe..0000000000 --- a/spring-boot-ops/src/main/resources/templates/other.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - -Spring Utils Demo - - - - Parameter set by you:

- - \ No newline at end of file diff --git a/spring-boot-ops/src/main/resources/templates/utils.html b/spring-boot-ops/src/main/resources/templates/utils.html deleted file mode 100644 index 93030f424f..0000000000 --- a/spring-boot-ops/src/main/resources/templates/utils.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - -Spring Utils Demo - - - -

-

Set Parameter:

-

- - -

-
-Another Page - - \ No newline at end of file diff --git a/spring-boot-ops/src/test/resources/application.properties b/spring-boot-ops/src/test/resources/application.properties index bda75c25fa..2095a82a14 100644 --- a/spring-boot-ops/src/test/resources/application.properties +++ b/spring-boot-ops/src/test/resources/application.properties @@ -2,8 +2,6 @@ spring.mail.host=localhost spring.mail.port=8025 spring.mail.properties.mail.smtp.auth=false -security.basic.enabled=false - management.endpoints.web.exposure.include=* management.endpoint.shutdown.enabled=true endpoints.shutdown.enabled=true \ No newline at end of file