Skip to content

Commit dff9fd3

Browse files
committed
Updated pom.xml with custom repo inclusion example
1 parent 6b11728 commit dff9fd3

File tree

4 files changed

+185
-118
lines changed

4 files changed

+185
-118
lines changed

pom.xml

Lines changed: 121 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,123 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5-
<modelVersion>4.0.0</modelVersion>
6-
7-
<groupId>com.delta</groupId>
8-
<artifactId>core</artifactId>
9-
<version>1.0-SNAPSHOT</version>
10-
<build>
11-
<plugins>
12-
<plugin>
13-
<groupId>org.apache.maven.plugins</groupId>
14-
<artifactId>maven-compiler-plugin</artifactId>
15-
<configuration>
16-
<source>1.8</source>
17-
<target>1.8</target>
18-
</configuration>
19-
</plugin>
20-
</plugins>
21-
</build>
22-
23-
<dependencies>
24-
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-jcs-core -->
25-
<dependency>
26-
<groupId>org.apache.commons</groupId>
27-
<artifactId>commons-jcs-core</artifactId>
28-
<version>2.0-beta-2</version>
29-
</dependency>
30-
31-
32-
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
33-
<dependency>
34-
<groupId>commons-logging</groupId>
35-
<artifactId>commons-logging</artifactId>
36-
<version>1.2</version>
37-
</dependency>
38-
39-
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
40-
<dependency>
41-
<groupId>org.projectlombok</groupId>
42-
<artifactId>lombok</artifactId>
43-
<version>1.16.8</version>
44-
</dependency>
45-
46-
47-
<!-- https://mvnrepository.com/artifact/net.sf.ehcache/ehcache -->
48-
<dependency>
49-
<groupId>net.sf.ehcache</groupId>
50-
<artifactId>ehcache</artifactId>
51-
<version>2.10.3</version>
52-
</dependency>
53-
54-
<!-- https://mvnrepository.com/artifact/org.ehcache/ehcache -->
55-
<dependency>
56-
<groupId>org.ehcache</groupId>
57-
<artifactId>ehcache</artifactId>
58-
<version>3.2.0</version>
59-
</dependency>
60-
61-
62-
<!--loggin-->
63-
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
64-
<dependency>
65-
<groupId>org.slf4j</groupId>
66-
<artifactId>slf4j-api</artifactId>
67-
<version>1.7.22</version>
68-
</dependency>
69-
70-
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
71-
<dependency>
72-
<groupId>org.slf4j</groupId>
73-
<artifactId>slf4j-simple</artifactId>
74-
<version>1.7.22</version>
75-
</dependency>
76-
<dependency>
77-
<groupId>org.springframework</groupId>
78-
<artifactId>spring-context</artifactId>
79-
<version>4.3.4.RELEASE</version>
80-
</dependency>
81-
<!-- https://mvnrepository.com/artifact/junit/junit -->
82-
<dependency>
83-
<groupId>junit</groupId>
84-
<artifactId>junit</artifactId>
85-
<version>4.12</version>
86-
</dependency>
87-
88-
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
89-
<dependency>
90-
<groupId>org.mockito</groupId>
91-
<artifactId>mockito-core</artifactId>
92-
<version>2.4.3</version>
93-
</dependency>
94-
95-
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
96-
<dependency>
97-
<groupId>com.googlecode.json-simple</groupId>
98-
<artifactId>json-simple</artifactId>
99-
<version>1.1.1</version>
100-
</dependency>
101-
102-
<!--jdbc mssql-->
103-
<!-- https://mvnrepository.com/artifact/com.microsoft/sqljdbc4 -->
104-
<dependency>
105-
<groupId>com.microsoft</groupId>
106-
<artifactId>sqljdbc4</artifactId>
107-
<version>3.0</version>
108-
</dependency>
109-
</dependencies>
110-
111-
<repositories>
112-
<repository>
113-
<id>Clojars</id>
114-
<name>your custom repo</name>
115-
<url>http://clojars.org/repo/</url>
116-
</repository>
117-
</repositories>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.delta</groupId>
7+
<artifactId>core</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
<build>
10+
<plugins>
11+
<plugin>
12+
<groupId>org.apache.maven.plugins</groupId>
13+
<artifactId>maven-compiler-plugin</artifactId>
14+
<configuration>
15+
<source>1.8</source>
16+
<target>1.8</target>
17+
</configuration>
18+
</plugin>
19+
</plugins>
20+
</build>
21+
22+
<dependencies>
23+
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-jcs-core -->
24+
<dependency>
25+
<groupId>org.apache.commons</groupId>
26+
<artifactId>commons-jcs-core</artifactId>
27+
<version>2.0-beta-2</version>
28+
</dependency>
29+
30+
31+
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
32+
<dependency>
33+
<groupId>commons-logging</groupId>
34+
<artifactId>commons-logging</artifactId>
35+
<version>1.2</version>
36+
</dependency>
37+
38+
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
39+
<dependency>
40+
<groupId>org.projectlombok</groupId>
41+
<artifactId>lombok</artifactId>
42+
<version>1.16.8</version>
43+
</dependency>
44+
45+
46+
<!-- https://mvnrepository.com/artifact/net.sf.ehcache/ehcache -->
47+
<dependency>
48+
<groupId>net.sf.ehcache</groupId>
49+
<artifactId>ehcache</artifactId>
50+
<version>2.10.3</version>
51+
</dependency>
52+
53+
<!-- https://mvnrepository.com/artifact/org.ehcache/ehcache -->
54+
<dependency>
55+
<groupId>org.ehcache</groupId>
56+
<artifactId>ehcache</artifactId>
57+
<version>3.2.0</version>
58+
</dependency>
59+
60+
61+
<!--loggin -->
62+
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
63+
<dependency>
64+
<groupId>org.slf4j</groupId>
65+
<artifactId>slf4j-api</artifactId>
66+
<version>1.7.22</version>
67+
</dependency>
68+
69+
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
70+
<dependency>
71+
<groupId>org.slf4j</groupId>
72+
<artifactId>slf4j-simple</artifactId>
73+
<version>1.7.22</version>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.springframework</groupId>
77+
<artifactId>spring-context</artifactId>
78+
<version>4.3.4.RELEASE</version>
79+
</dependency>
80+
<!-- https://mvnrepository.com/artifact/junit/junit -->
81+
<dependency>
82+
<groupId>junit</groupId>
83+
<artifactId>junit</artifactId>
84+
<version>4.12</version>
85+
</dependency>
86+
87+
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
88+
<dependency>
89+
<groupId>org.mockito</groupId>
90+
<artifactId>mockito-core</artifactId>
91+
<version>2.4.3</version>
92+
</dependency>
93+
94+
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
95+
<dependency>
96+
<groupId>com.googlecode.json-simple</groupId>
97+
<artifactId>json-simple</artifactId>
98+
<version>1.1.1</version>
99+
</dependency>
100+
101+
<!--jdbc mssql -->
102+
<!-- https://mvnrepository.com/artifact/com.microsoft/sqljdbc4 -->
103+
<dependency>
104+
<groupId>com.microsoft</groupId>
105+
<artifactId>sqljdbc4</artifactId>
106+
<version>3.0</version>
107+
</dependency>
108+
109+
<dependency>
110+
<groupId>joda-time</groupId>
111+
<artifactId>joda-time</artifactId>
112+
<version>2.9.9</version>
113+
</dependency>
114+
</dependencies>
115+
116+
<repositories>
117+
<repository>
118+
<id>Clojars</id>
119+
<name>your custom repo</name>
120+
<url>http://clojars.org/repo/</url>
121+
</repository>
122+
</repositories>
118123
</project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
*
3+
*/
4+
package com.eprogrammerz.examples.general.collection;
5+
6+
import java.util.TreeMap;
7+
8+
/**
9+
* @author Yogen
10+
*
11+
*/
12+
public class MostFrequentElement {
13+
14+
public static void main(String[] args) {
15+
String[] elems = {"a", "b", "c", "b", "d", "a", "b"};
16+
17+
TreeMap<String, Integer> elemFreq = new TreeMap<>();
18+
19+
for(String e: elems) {
20+
if(elemFreq.containsKey(e)) {
21+
elemFreq.put(e, elemFreq.get(e) + 1);
22+
} else {
23+
elemFreq.put(e, 1);
24+
}
25+
}
26+
27+
System.out.println(elemFreq);
28+
}
29+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
*
3+
*/
4+
package com.eprogrammerz.examples.general.dateapi;
5+
6+
import java.text.DateFormat;
7+
import java.text.ParseException;
8+
import java.text.SimpleDateFormat;
9+
import java.util.Date;
10+
11+
import org.joda.time.DateTime;
12+
import org.joda.time.LocalTime;
13+
14+
/**
15+
* @author Yogen
16+
*
17+
*/
18+
public class DateExample {
19+
public static void main(String[] args) {
20+
final String DEGREE = "\u00b0";
21+
System.out.println(DEGREE);
22+
23+
24+
DateTime todayNoon = new DateTime().withTimeAtStartOfDay().plusHours(12);
25+
long todayNoonMills = todayNoon.getMillis();
26+
System.out.println(todayNoonMills);
27+
System.out.println(1500940800);
28+
Date date = new Date(todayNoonMills);
29+
System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date));
30+
}
31+
32+
}

src/main/java/com/eprogrammerz/examples/general/regexexample/URLmatcher.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
public class URLmatcher {
1414

1515
public static void main(String[] args) {
16-
String url = "/api/v0.1/userrs?name=yogen&password=pass";
17-
final String URL_PATTERN = "/api/([a-z0-9.]+)/(?!users)([a-zA-Z0-9]+)(/([a-z0-9]+))*(\\?([a-zA-Z0-9]+)=([a-z0-9]+)(&([a-zA-Z0-9]+)=([a-z0-9]+))*)*";
16+
String url = "/api/v0.1/users?name=yogen&password=pass";
17+
// final String URL_PATTERN = "/api/([a-z0-9.]+)/(?!user|master)([a-zA-Z0-9]+)(/([a-z0-9]+))*(\\?([a-zA-Z0-9]+)=([a-z0-9]+)(&([a-zA-Z0-9]+)=([a-z0-9]+))*)*";
18+
final String URL_PATTERN = "/api/([a-z0-9.]+)/(\\b(?!user)\\b)(?!master)([a-zA-Z0-9]+)(/([a-z0-9]+))*(\\?([a-zA-Z0-9]+)=([a-z0-9]+)(&([a-zA-Z0-9]+)=([a-z0-9]+))*)*";
1819
Pattern r = Pattern.compile(URL_PATTERN);
1920
Matcher m = r.matcher(url);
2021

0 commit comments

Comments
 (0)