Repository: jmrozanec/cron-utils
Pull request #531 (2022-07-30 15:49:17)

Change resource locations
Our project uses maven shade plugin to shade cron-utils into our release jar. 

When doing so, a lot of resources of cron-utils end up in the root directory of the jar:

![grafik](https://user-images.githubusercontent.com/17405009/181924921-00786556-9704-45ec-8a64-635eeaf710a6.png)

Therefore I'dd like to propose the following changes:

1. Move the `checkstyle.xml` to a config folder, as it is not a resource of the code and is not needed in released artifacts.
2.  Move the resource bundle to `com.cronutils` package, so you can easily see where they belong to and are able to relocate them when shading cron-utils into your project.

_Also I changed `it` translation from `CRLF` to `LF` line breaks._



Patch:
diff --git a/.checkstyle b/.checkstyle
index c07bff4..dda6cd6 100644
--- a/.checkstyle
+++ b/.checkstyle
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
-  <local-check-config name="cron-utils-configuration" location="src/main/resources/checkstyle.xml" type="project" description="">
+  <local-check-config name="cron-utils-configuration" location="config/checkstyle.xml" type="project" description="">
     <additional-data name="protect-config-file" value="false"/>
   </local-check-config>
   <fileset name="all" enabled="true" check-config-name="cron-utils-configuration" local="true">
diff --git a/src/main/resources/checkstyle.xml b/config/checkstyle.xml
old mode 100755
new mode 100644
similarity index 100%
rename from src/main/resources/checkstyle.xml
rename to config/checkstyle.xml
diff --git a/pom.xml b/pom.xml
index e0e62cb..018f042 100644
--- a/pom.xml
+++ b/pom.xml
@@ -169,7 +169,7 @@
                 <artifactId>maven-checkstyle-plugin</artifactId>
                 <version>2.17</version>
                 <configuration>
-                    <configLocation>src/main/resources/checkstyle.xml</configLocation>
+                    <configLocation>config/checkstyle.xml</configLocation>
                 </configuration>
             </plugin>
             <plugin>
diff --git a/src/main/java/com/cronutils/descriptor/CronDescriptor.java b/src/main/java/com/cronutils/descriptor/CronDescriptor.java
index 39ac1ca..fe5e246 100755
--- a/src/main/java/com/cronutils/descriptor/CronDescriptor.java
+++ b/src/main/java/com/cronutils/descriptor/CronDescriptor.java
@@ -30,7 +30,7 @@ import java.util.ResourceBundle;
 public class CronDescriptor {
 
     public static final Locale DEFAULT_LOCALE = Locale.UK;
-    private static final String BUNDLE = "CronUtilsI18N";
+    private static final String BUNDLE = "com.cronutils.CronUtilsI18N";
     private final ResourceBundle resourceBundle;
 
     /**
diff --git a/src/main/resources/CronUtilsI18N.properties b/src/main/resources/com/cronutils/CronUtilsI18N.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N.properties
diff --git a/src/main/resources/CronUtilsI18N_de.properties b/src/main/resources/com/cronutils/CronUtilsI18N_de.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_de.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_de.properties
diff --git a/src/main/resources/CronUtilsI18N_el.properties b/src/main/resources/com/cronutils/CronUtilsI18N_el.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_el.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_el.properties
diff --git a/src/main/resources/CronUtilsI18N_en.properties b/src/main/resources/com/cronutils/CronUtilsI18N_en.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_en.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_en.properties
diff --git a/src/main/resources/CronUtilsI18N_es.properties b/src/main/resources/com/cronutils/CronUtilsI18N_es.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_es.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_es.properties
diff --git a/src/main/resources/CronUtilsI18N_fr.properties b/src/main/resources/com/cronutils/CronUtilsI18N_fr.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_fr.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_fr.properties
diff --git a/src/main/resources/CronUtilsI18N_id.properties b/src/main/resources/com/cronutils/CronUtilsI18N_id.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_id.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_id.properties
diff --git a/src/main/resources/CronUtilsI18N_it.properties b/src/main/resources/com/cronutils/CronUtilsI18N_it.properties
similarity index 95%
rename from src/main/resources/CronUtilsI18N_it.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_it.properties
index c96b231..4579755 100644
--- a/src/main/resources/CronUtilsI18N_it.properties
+++ b/src/main/resources/com/cronutils/CronUtilsI18N_it.properties
@@ -1,33 +1,33 @@
-between_x_and_y=tra {0} e {1}
-every=ogni
-and=e
-at=alle
-day=giorno
-days=giorni
-hour=ora
-hours=ore
-minute=minuto
-minutes=minuti
-second=secondo
-seconds=secondi
-month=mese
-months=mesi
-year=anno
-years=anni
-between=tra
-of_every_month=di ogni mese
-of_the_month=del mese
-last=ultimo
-the_nearest_weekday_to_the=il giorno della settimana piu' vicino a
-last_day_of_month=ultimo giorno del mese
-last_weekday_of_month=ultimo giorno della settimana nel mese
-day_before_last_day_of_month=un giorno prima dell'ultimo giorno del mese
-days_before_last_day_of_month={0} giorni prima dell'ultimo giorno del mese
-
-pattern_every_seconds = {0} {1}
-every_one=ogni
-every_multi=ogni
-oneSecond=secondo
-multipleSeconds={2} secondi
-
-pattern_at_second=al secondo {0}
+between_x_and_y=tra {0} e {1}
+every=ogni
+and=e
+at=alle
+day=giorno
+days=giorni
+hour=ora
+hours=ore
+minute=minuto
+minutes=minuti
+second=secondo
+seconds=secondi
+month=mese
+months=mesi
+year=anno
+years=anni
+between=tra
+of_every_month=di ogni mese
+of_the_month=del mese
+last=ultimo
+the_nearest_weekday_to_the=il giorno della settimana piu' vicino a
+last_day_of_month=ultimo giorno del mese
+last_weekday_of_month=ultimo giorno della settimana nel mese
+day_before_last_day_of_month=un giorno prima dell'ultimo giorno del mese
+days_before_last_day_of_month={0} giorni prima dell'ultimo giorno del mese
+
+pattern_every_seconds = {0} {1}
+every_one=ogni
+every_multi=ogni
+oneSecond=secondo
+multipleSeconds={2} secondi
+
+pattern_at_second=al secondo {0}


Test patch:
diff --git a/src/main/resources/CronUtilsI18N_ja.properties b/src/main/resources/com/cronutils/CronUtilsI18N_ja.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_ja.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_ja.properties
diff --git a/src/main/resources/CronUtilsI18N_ko.properties b/src/main/resources/com/cronutils/CronUtilsI18N_ko.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_ko.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_ko.properties
diff --git a/src/main/resources/CronUtilsI18N_nl.properties b/src/main/resources/com/cronutils/CronUtilsI18N_nl.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_nl.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_nl.properties
diff --git a/src/main/resources/CronUtilsI18N_pl.properties b/src/main/resources/com/cronutils/CronUtilsI18N_pl.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_pl.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_pl.properties
diff --git a/src/main/resources/CronUtilsI18N_pt.properties b/src/main/resources/com/cronutils/CronUtilsI18N_pt.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_pt.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_pt.properties
diff --git a/src/main/resources/CronUtilsI18N_ro.properties b/src/main/resources/com/cronutils/CronUtilsI18N_ro.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_ro.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_ro.properties
diff --git a/src/main/resources/CronUtilsI18N_ru.properties b/src/main/resources/com/cronutils/CronUtilsI18N_ru.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_ru.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_ru.properties
diff --git a/src/main/resources/CronUtilsI18N_sw.properties b/src/main/resources/com/cronutils/CronUtilsI18N_sw.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_sw.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_sw.properties
diff --git a/src/main/resources/CronUtilsI18N_tr.properties b/src/main/resources/com/cronutils/CronUtilsI18N_tr.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_tr.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_tr.properties
diff --git a/src/main/resources/CronUtilsI18N_zh.properties b/src/main/resources/com/cronutils/CronUtilsI18N_zh.properties
similarity index 100%
rename from src/main/resources/CronUtilsI18N_zh.properties
rename to src/main/resources/com/cronutils/CronUtilsI18N_zh.properties
diff --git a/src/test/java/com/cronutils/utils/descriptor/TestDescriptor.java b/src/test/java/com/cronutils/utils/descriptor/TestDescriptor.java
index 22e3ee0..939ac2d 100644
--- a/src/test/java/com/cronutils/utils/descriptor/TestDescriptor.java
+++ b/src/test/java/com/cronutils/utils/descriptor/TestDescriptor.java
@@ -50,63 +50,63 @@ public class TestDescriptor {
 	@Test
 	public void testEverySecond() {
 		final Cron cron = getCron("* * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.UK));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.UK));
 		assertEquals("every second", t.describe(cron));
 	}
 
 	@Test
 	public void testEvery1Second() {
 		final Cron cron = getCron("*/1 * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.UK));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.UK));
 		assertEquals("every second", t.describe(cron));
 	}
 
 	@Test
 	public void testEvery2Seconds() {
 		final Cron cron = getCron("*/2 * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.UK));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.UK));
 		assertEquals("every 2 seconds", t.describe(cron));
 	}
 
 	@Test
 	public void testEverySecondGerman() {
 		final Cron cron = getCron("* * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.GERMAN));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.GERMAN));
 		assertEquals("jede sekunde", t.describe(cron));
 	}
 
 	@Test
 	public void testEverySecondItalian() {
 		final Cron cron = getCron("* * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.ITALIAN));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.ITALIAN));
 		assertEquals("ogni secondo", t.describe(cron));
 	}
 
 	@Test
 	public void testEvery1SecondGerman() {
 		final Cron cron = getCron("*/1 * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.GERMAN));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.GERMAN));
 		assertEquals("jede sekunde", t.describe(cron));
 	}
 
 	@Test
 	public void testEvery1SecondITalian() {
 		final Cron cron = getCron("*/1 * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.ITALIAN));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.ITALIAN));
 		assertEquals("ogni secondo", t.describe(cron));
 	}
 
 	@Test
 	public void testEvery2SecondsGerman() {
 		final Cron cron = getCron("*/2 * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.GERMAN));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.GERMAN));
 		assertEquals("alle 2 sekunden", t.describe(cron));
 	}
 
 	@Test
 	public void testEvery2SecondsItalian() {
 		final Cron cron = getCron("*/2 * * * * ? *");
-		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("CronUtilsI18N", Locale.ITALIAN));
+		final TimeDescriptor t = new TimeDescriptor(ResourceBundle.getBundle("com.cronutils.CronUtilsI18N", Locale.ITALIAN));
 		assertEquals("ogni 2 secondi", t.describe(cron));
 	}