Skip to content

Commit bb54520

Browse files
committed
Feature: Create Custom Maven plugin to execute a SQLSheme2Java Core and run test example on End build
1 parent 5408bdc commit bb54520

46 files changed

Lines changed: 407 additions & 137 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ buildNumber.properties
1515
.settings/org.eclipse.jdt.core.prefs
1616
.settings/org.eclipse.m2e.core.prefs
1717
.settings/org.springframework.ide.eclipse.prefs
18+
sqlschema2java-example/.settings/org.eclipse.m2e.core.prefs
19+
sqlschema2java-example/src
20+
sqlschema2java-maven-plugin/.settings/org.eclipse.jdt.core.prefs
21+
sqlschema2java-maven-plugin/.settings/org.eclipse.m2e.core.prefs
22+
sqlschema2java-maven-plugin/.settings/org.springframework.ide.eclipse.prefs

buildAndRunExample.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
printf "
4+
_____ ____ __ ___ _____ _ _____
5+
/ ___// __ \ / / |__ \ / / | | / / |
6+
\__ \/ / / / / / __/ /__ / / /| | | / / /| |
7+
___/ / /_/ / / /___/ __// /_/ / ___ | |/ / ___ |
8+
/____/\___\_\/_____/____/\____/_/ |_|___/_/ |_|
9+
10+
Github : https://github.com/Sassine/sqlschema2java
11+
12+
"
13+
14+
mvn install
15+
16+
cd sqlschema2java-example/
17+
18+
./runSqlSchema2Java.sh

pom.xml

Lines changed: 17 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<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>
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+
<artifactId>sqlschema2java</artifactId>
7+
<version>1.0.0-SNAPSHOT</version>
8+
<name>sqlschema2java</name>
9+
<packaging>pom</packaging>
10+
<groupId>dev.sassine.api</groupId>
611

7-
<groupId>dev.sassine.api.structure</groupId>
8-
<artifactId>sqlschema2java</artifactId>
9-
<version>1.0-SNAPSHOT</version>
1012

11-
<name>sqlschema2java</name>
12-
<description> Auto generate Class DTO, Entity and Repository from SQL Query. </description>
13-
<url>https://sassine.dev/</url>
14-
15-
<properties>
16-
<java.version>11</java.version>
17-
</properties>
18-
19-
<developers>
13+
<developers>
2014
<developer>
2115
<name>Sassine El-Asmar</name>
2216
<id>sassineasmar</id>
@@ -29,125 +23,11 @@
2923
</developer>
3024
</developers>
3125

32-
<build>
33-
<plugins>
34-
<plugin>
35-
<groupId>org.pitest</groupId>
36-
<artifactId>pitest-maven</artifactId>
37-
<version>1.7.5</version>
38-
<configuration>
39-
<targetClasses>
40-
<param>dev.sassine.api.structure.export.*</param>
41-
<param>dev.sassine.api.structure.model.*</param>
42-
<param>dev.sassine.api.structure.parser.*</param>
43-
<param>dev.sassine.api.structure.type.*</param>
44-
<param>dev.sassine.api.structure.util.*</param>
45-
<param>dev.sassine.api.structure.validation.*</param>
46-
</targetClasses>
47-
<targetTests>
48-
<param>dev.sassine.api.structure.export.*</param>
49-
<param>dev.sassine.api.structure.model.*</param>
50-
<param>dev.sassine.api.structure.parser.*</param>
51-
<param>dev.sassine.api.structure.type.*</param>
52-
<param>dev.sassine.api.structure.util.*</param>
53-
<param>dev.sassine.api.structure.validation.*</param>
54-
</targetTests>
55-
</configuration>
56-
</plugin>
57-
<plugin>
58-
<groupId>org.antlr</groupId>
59-
<artifactId>antlr4-maven-plugin</artifactId>
60-
<version>4.3</version>
61-
<executions>
62-
<execution>
63-
<id>antlr</id>
64-
<goals>
65-
<goal>antlr4</goal>
66-
</goals>
67-
</execution>
68-
</executions>
69-
</plugin>
70-
<plugin>
71-
<groupId>org.apache.maven.plugins</groupId>
72-
<artifactId>maven-resources-plugin</artifactId>
73-
<version>2.6</version>
74-
<configuration>
75-
<encoding>UTF-8</encoding>
76-
</configuration>
77-
</plugin>
78-
<plugin>
79-
<groupId>org.apache.maven.plugins</groupId>
80-
<artifactId>maven-compiler-plugin</artifactId>
81-
<version>3.8.0</version>
82-
<configuration>
83-
<sql-file>./sql.sql</sql-file>
84-
<encoding>UTF-8</encoding>
85-
<source>11</source>
86-
<target>11</target>
87-
</configuration>
88-
</plugin>
89-
</plugins>
90-
</build>
91-
92-
<dependencies>
93-
<dependency>
94-
<groupId>org.antlr</groupId>
95-
<artifactId>antlr4-runtime</artifactId>
96-
<version>4.3</version>
97-
</dependency>
98-
99-
<dependency>
100-
<groupId>org.burningwave</groupId>
101-
<artifactId>core</artifactId>
102-
<version>12.47.0</version>
103-
</dependency>
104-
105-
<dependency>
106-
<groupId>org.projectlombok</groupId>
107-
<artifactId>lombok</artifactId>
108-
<version>1.18.22</version>
109-
<scope>provided</scope>
110-
</dependency>
111-
112-
<dependency>
113-
<groupId>org.springframework.boot</groupId>
114-
<artifactId>spring-boot-starter-data-jpa</artifactId>
115-
<version>2.4.2</version>
116-
</dependency>
117-
118-
<dependency>
119-
<groupId>org.apache.commons</groupId>
120-
<artifactId>commons-text</artifactId>
121-
<version>1.9</version>
122-
</dependency>
123-
124-
<dependency>
125-
<groupId>org.json</groupId>
126-
<artifactId>json</artifactId>
127-
<version>20140107</version>
128-
</dependency>
129-
<dependency>
130-
<groupId>com.fasterxml.jackson.core</groupId>
131-
<artifactId>jackson-core</artifactId>
132-
<version>2.4.2</version>
133-
</dependency>
134-
<dependency>
135-
<groupId>com.fasterxml.jackson.core</groupId>
136-
<artifactId>jackson-annotations</artifactId>
137-
<version>2.4.2</version>
138-
</dependency>
139-
<dependency>
140-
<groupId>com.fasterxml.jackson.core</groupId>
141-
<artifactId>jackson-databind</artifactId>
142-
<version>2.4.2</version>
143-
</dependency>
144-
145-
<dependency>
146-
<groupId>junit</groupId>
147-
<artifactId>junit</artifactId>
148-
<version>4.10</version>
149-
<scope>test</scope>
150-
</dependency>
151-
</dependencies>
152-
153-
</project>
26+
27+
<modules>
28+
<module>sqlschema2java-core</module>
29+
<module>sqlschema2java-example</module>
30+
<module>sqlschema2java-maven-plugin</module>
31+
</modules>
32+
33+
</project>

sqlschema2java-core/.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
target/
2+
pom.xml.tag
3+
pom.xml.releaseBackup
4+
pom.xml.versionsBackup
5+
pom.xml.next
6+
release.properties
7+
dependency-reduced-pom.xml
8+
buildNumber.properties
9+
.mvn/timing.properties
10+
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
11+
.mvn/wrapper/maven-wrapper.jar
12+
.classpath
13+
.project
14+
.settings/org.eclipse.core.resources.prefs
15+
.settings/org.eclipse.jdt.core.prefs
16+
.settings/org.eclipse.m2e.core.prefs
17+
.settings/org.springframework.ide.eclipse.prefs

sqlschema2java-core/pom.xml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<?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>dev.sassine.api.structure</groupId>
8+
<artifactId>sqlschema2java</artifactId>
9+
<version>1.0.0-SNAPSHOT</version>
10+
11+
<name>sqlschema2java</name>
12+
<description> Auto generate Class DTO, Entity and Repository from SQL Query. </description>
13+
<url>https://sassine.dev/</url>
14+
15+
<properties>
16+
<java.version>11</java.version>
17+
</properties>
18+
19+
<developers>
20+
<developer>
21+
<name>Sassine El-Asmar</name>
22+
<id>sassineasmar</id>
23+
<organization>Sassine.dev</organization>
24+
<organizationUrl>https://sassine.dev/</organizationUrl>
25+
<roles>
26+
<role>Administrator</role>
27+
<role>Developer</role>
28+
</roles>
29+
</developer>
30+
</developers>
31+
32+
<build>
33+
<plugins>
34+
<plugin>
35+
<groupId>org.pitest</groupId>
36+
<artifactId>pitest-maven</artifactId>
37+
<version>1.7.5</version>
38+
<configuration>
39+
<targetClasses>
40+
<param>dev.sassine.api.structure.export.*</param>
41+
<param>dev.sassine.api.structure.model.*</param>
42+
<param>dev.sassine.api.structure.parser.*</param>
43+
<param>dev.sassine.api.structure.type.*</param>
44+
<param>dev.sassine.api.structure.util.*</param>
45+
<param>dev.sassine.api.structure.validation.*</param>
46+
</targetClasses>
47+
<targetTests>
48+
<param>dev.sassine.api.structure.export.*</param>
49+
<param>dev.sassine.api.structure.model.*</param>
50+
<param>dev.sassine.api.structure.parser.*</param>
51+
<param>dev.sassine.api.structure.type.*</param>
52+
<param>dev.sassine.api.structure.util.*</param>
53+
<param>dev.sassine.api.structure.validation.*</param>
54+
</targetTests>
55+
</configuration>
56+
</plugin>
57+
<plugin>
58+
<groupId>org.antlr</groupId>
59+
<artifactId>antlr4-maven-plugin</artifactId>
60+
<version>4.3</version>
61+
<executions>
62+
<execution>
63+
<id>antlr</id>
64+
<goals>
65+
<goal>antlr4</goal>
66+
</goals>
67+
</execution>
68+
</executions>
69+
</plugin>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-resources-plugin</artifactId>
73+
<version>2.6</version>
74+
<configuration>
75+
<encoding>UTF-8</encoding>
76+
</configuration>
77+
</plugin>
78+
<plugin>
79+
<groupId>org.apache.maven.plugins</groupId>
80+
<artifactId>maven-compiler-plugin</artifactId>
81+
<version>3.8.0</version>
82+
<configuration>
83+
<sql-file>./sql.sql</sql-file>
84+
<encoding>UTF-8</encoding>
85+
<source>11</source>
86+
<target>11</target>
87+
</configuration>
88+
</plugin>
89+
</plugins>
90+
</build>
91+
92+
<dependencies>
93+
<dependency>
94+
<groupId>org.antlr</groupId>
95+
<artifactId>antlr4-runtime</artifactId>
96+
<version>4.3</version>
97+
</dependency>
98+
99+
<dependency>
100+
<groupId>org.burningwave</groupId>
101+
<artifactId>core</artifactId>
102+
<version>12.47.0</version>
103+
</dependency>
104+
105+
<dependency>
106+
<groupId>org.projectlombok</groupId>
107+
<artifactId>lombok</artifactId>
108+
<version>1.18.22</version>
109+
<scope>provided</scope>
110+
</dependency>
111+
112+
<dependency>
113+
<groupId>org.springframework.boot</groupId>
114+
<artifactId>spring-boot-starter-data-jpa</artifactId>
115+
<version>2.4.2</version>
116+
</dependency>
117+
118+
<dependency>
119+
<groupId>org.apache.commons</groupId>
120+
<artifactId>commons-text</artifactId>
121+
<version>1.9</version>
122+
</dependency>
123+
124+
<dependency>
125+
<groupId>org.json</groupId>
126+
<artifactId>json</artifactId>
127+
<version>20140107</version>
128+
</dependency>
129+
<dependency>
130+
<groupId>com.fasterxml.jackson.core</groupId>
131+
<artifactId>jackson-core</artifactId>
132+
<version>2.4.2</version>
133+
</dependency>
134+
<dependency>
135+
<groupId>com.fasterxml.jackson.core</groupId>
136+
<artifactId>jackson-annotations</artifactId>
137+
<version>2.4.2</version>
138+
</dependency>
139+
<dependency>
140+
<groupId>com.fasterxml.jackson.core</groupId>
141+
<artifactId>jackson-databind</artifactId>
142+
<version>2.4.2</version>
143+
</dependency>
144+
145+
<dependency>
146+
<groupId>junit</groupId>
147+
<artifactId>junit</artifactId>
148+
<version>4.10</version>
149+
<scope>test</scope>
150+
</dependency>
151+
</dependencies>
152+
153+
</project>

src/main/antlr4/dev/sassine/api/structure/Sql.g4 renamed to sqlschema2java-core/src/main/antlr4/dev/sassine/api/structure/Sql.g4

File renamed without changes.

src/main/java/dev/sassine/api/structure/Main.java renamed to sqlschema2java-core/src/main/java/dev/sassine/api/structure/Main.java

File renamed without changes.

src/main/java/dev/sassine/api/structure/Sqlschema2Java.java renamed to sqlschema2java-core/src/main/java/dev/sassine/api/structure/Sqlschema2Java.java

File renamed without changes.

src/main/java/dev/sassine/api/structure/export/DatabaseConverter.java renamed to sqlschema2java-core/src/main/java/dev/sassine/api/structure/export/DatabaseConverter.java

File renamed without changes.

src/main/java/dev/sassine/api/structure/export/builder/BuilderEntity.java renamed to sqlschema2java-core/src/main/java/dev/sassine/api/structure/export/builder/BuilderEntity.java

File renamed without changes.

0 commit comments

Comments
 (0)