Browse Source

Make bootstrap beans in "dev" only.

Andrew Grant 6 months ago
parent
commit
2a84e8c7f7

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadCensus.java

@@ -7,6 +7,7 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.commands.census.CensusCommand;
 import scot.carricksoftware.grants.commands.census.CensusCommand;
 import scot.carricksoftware.grants.commands.census.CensusCommandImpl;
 import scot.carricksoftware.grants.commands.census.CensusCommandImpl;
@@ -21,6 +22,7 @@ import scot.carricksoftware.grants.services.places.places.PlaceService;
 import java.time.LocalDate;
 import java.time.LocalDate;
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoadCensus {
 public class DataLoadCensus {
 
 
     private static final Logger logger = LogManager.getLogger(DataLoadCensus.class);
     private static final Logger logger = LogManager.getLogger(DataLoadCensus.class);

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificates.java

@@ -7,6 +7,7 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
@@ -15,6 +16,7 @@ import scot.carricksoftware.grants.services.certificates.deathcertificates.Death
 import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.people.PersonService;
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoadCertificates {
 public class DataLoadCertificates {
 
 
     private static final Logger logger = LogManager.getLogger(DataLoadCertificates.class);
     private static final Logger logger = LogManager.getLogger(DataLoadCertificates.class);

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadImages.java

@@ -7,6 +7,7 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.commands.images.*;
 import scot.carricksoftware.grants.commands.images.*;
 import scot.carricksoftware.grants.services.images.image.ImageService;
 import scot.carricksoftware.grants.services.images.image.ImageService;
@@ -16,6 +17,7 @@ import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.places.places.PlaceService;
 import scot.carricksoftware.grants.services.places.places.PlaceService;
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoadImages {
 public class DataLoadImages {
 
 
     private static final Logger logger = LogManager.getLogger(DataLoadImages.class);
     private static final Logger logger = LogManager.getLogger(DataLoadImages.class);

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadPeople.java

@@ -7,12 +7,14 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.people.PersonService;
 
 
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoadPeople {
 public class DataLoadPeople {
 
 
     private static final Logger logger = LogManager.getLogger(DataLoadPeople.class);
     private static final Logger logger = LogManager.getLogger(DataLoadPeople.class);

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadPlaces.java

@@ -7,6 +7,7 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.domains.places.Country;
 import scot.carricksoftware.grants.domains.places.Country;
 import scot.carricksoftware.grants.domains.places.Place;
 import scot.carricksoftware.grants.domains.places.Place;
@@ -16,6 +17,7 @@ import scot.carricksoftware.grants.services.places.places.PlaceService;
 import scot.carricksoftware.grants.services.places.regions.RegionService;
 import scot.carricksoftware.grants.services.places.regions.RegionService;
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoadPlaces {
 public class DataLoadPlaces {
 
 
     private static final Logger logger = LogManager.getLogger(DataLoadPlaces.class);
     private static final Logger logger = LogManager.getLogger(DataLoadPlaces.class);

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadTexts.java

@@ -7,6 +7,7 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.commands.text.*;
 import scot.carricksoftware.grants.commands.text.*;
 import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.people.PersonService;
@@ -16,6 +17,7 @@ import scot.carricksoftware.grants.services.text.persontext.PersonTextService;
 import scot.carricksoftware.grants.services.text.placetext.PlaceTextService;
 import scot.carricksoftware.grants.services.text.placetext.PlaceTextService;
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoadTexts {
 public class DataLoadTexts {
 
 
     private static final Logger logger = LogManager.getLogger(DataLoadTexts.class);
     private static final Logger logger = LogManager.getLogger(DataLoadTexts.class);

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoadTwoPartyCertificates.java

@@ -7,6 +7,7 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import scot.carricksoftware.grants.domains.certificates.DivorceCertificate;
 import scot.carricksoftware.grants.domains.certificates.DivorceCertificate;
 import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
 import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
@@ -15,6 +16,7 @@ import scot.carricksoftware.grants.services.certificates.marriagecertificates.Ma
 import scot.carricksoftware.grants.services.people.PersonService;
 import scot.carricksoftware.grants.services.people.PersonService;
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoadTwoPartyCertificates {
 public class DataLoadTwoPartyCertificates {
 
 
     private static final Logger logger = LogManager.getLogger(DataLoadTwoPartyCertificates.class);
     private static final Logger logger = LogManager.getLogger(DataLoadTwoPartyCertificates.class);

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoader.java

@@ -8,10 +8,12 @@ package scot.carricksoftware.grants.bootstrap;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
 import org.springframework.boot.CommandLineRunner;
 import org.springframework.boot.CommandLineRunner;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoader implements CommandLineRunner {
 public class DataLoader implements CommandLineRunner {
 
 
 
 

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoaderPrimary.java

@@ -7,10 +7,12 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoaderPrimary {
 public class DataLoaderPrimary {
 
 
     private static final Logger logger = LogManager.getLogger(DataLoaderPrimary.class);
     private static final Logger logger = LogManager.getLogger(DataLoaderPrimary.class);

+ 2 - 0
src/main/java/scot/carricksoftware/grants/bootstrap/DataLoaderSecondary.java

@@ -7,10 +7,12 @@ package scot.carricksoftware.grants.bootstrap;
 
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.Logger;
+import org.springframework.context.annotation.Profile;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
 
 
 @Component
 @Component
+@Profile("dev")
 public class DataLoaderSecondary {
 public class DataLoaderSecondary {