Skip to content

Commit 1ba5e25

Browse files
committed
Add example translation and application.
1 parent eab5367 commit 1ba5e25

File tree

3 files changed

+6139
-0
lines changed

3 files changed

+6139
-0
lines changed

pom.xml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.github.javadev</groupId>
5+
<artifactId>nosql</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<packaging>jar</packaging>
8+
<name>Nosql command line translation tool json</name>
9+
<description>The nosql command line translation tool json</description>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<maven.compiler.source>1.8</maven.compiler.source>
14+
<maven.compiler.target>1.8</maven.compiler.target>
15+
</properties>
16+
17+
<build>
18+
<finalName>${project.artifactId}</finalName>
19+
<plugins>
20+
<plugin>
21+
<groupId>org.apache.maven.plugins</groupId>
22+
<artifactId>maven-jar-plugin</artifactId>
23+
<version>3.0.2</version>
24+
<configuration>
25+
<archive>
26+
<manifest>
27+
<mainClass>com.github.nosql.Nosql</mainClass>
28+
</manifest>
29+
</archive>
30+
</configuration>
31+
</plugin>
32+
<plugin>
33+
<groupId>org.apache.maven.plugins</groupId>
34+
<artifactId>maven-shade-plugin</artifactId>
35+
<version>2.4.3</version>
36+
<executions>
37+
<execution>
38+
<phase>package</phase>
39+
<goals>
40+
<goal>shade</goal>
41+
</goals>
42+
<configuration>
43+
<filters>
44+
<filter>
45+
<artifact>*:*</artifact>
46+
<excludes>
47+
<exclude>META-INF/maven/**</exclude>
48+
<exclude>META-INF/COPYRIGHT.html</exclude>
49+
<exclude>META-INF/LICENSE*</exclude>
50+
<exclude>META-INF/NOTICE*</exclude>
51+
<exclude>META-INF/README.txt</exclude>
52+
<exclude>META-INF/DEPENDENCIES*</exclude>
53+
<exclude>LICENSE.txt</exclude>
54+
<exclude>rhinoDiff.txt</exclude>
55+
<exclude>license/**</exclude>
56+
</excludes>
57+
</filter>
58+
</filters>
59+
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
60+
</configuration>
61+
</execution>
62+
</executions>
63+
</plugin>
64+
<plugin>
65+
<groupId>com.github.wvengen</groupId>
66+
<artifactId>proguard-maven-plugin</artifactId>
67+
<version>2.0.13</version>
68+
<executions>
69+
<execution>
70+
<phase>package</phase>
71+
<goals><goal>proguard</goal></goals>
72+
</execution>
73+
</executions>
74+
<configuration>
75+
<options>
76+
<option>-allowaccessmodification</option>
77+
<option>-keep public class com.github.nosql.Nosql</option>
78+
<option>-dontwarn</option>
79+
<option>-keepclassmembers class * { *** main(java.lang.String[]); }</option>
80+
<option>-ignorewarnings</option>
81+
<option>-dontnote</option>
82+
<option>-keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String);}</option>
83+
</options>
84+
<libs>
85+
<lib>${java.home}/lib/rt.jar</lib>
86+
<lib>${java.home}/lib/jce.jar</lib>
87+
</libs>
88+
</configuration>
89+
</plugin>
90+
</plugins>
91+
</build>
92+
93+
<dependencies>
94+
<dependency>
95+
<groupId>com.github.javadev</groupId>
96+
<artifactId>underscore</artifactId>
97+
<version>1.43</version>
98+
</dependency>
99+
<dependency>
100+
<groupId>commons-cli</groupId>
101+
<artifactId>commons-cli</artifactId>
102+
<version>1.2</version>
103+
</dependency>
104+
<dependency>
105+
<groupId>junit</groupId>
106+
<artifactId>junit</artifactId>
107+
<version>4.12</version>
108+
<scope>test</scope>
109+
</dependency>
110+
</dependencies>
111+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.github.nosql;
2+
3+
import com.github.underscore.lodash.Json;
4+
import com.github.underscore.lodash.U;
5+
import com.github.underscore.lodash.Xml;
6+
import org.apache.commons.cli.Options;
7+
8+
public class Nosql {
9+
/**
10+
* @param args the command line arguments
11+
*/
12+
public static void main(String args[]) throws Exception {
13+
Options options = new Options();
14+
options.addOption("s", "src", true, "The source file/directory which should be converted from xml/json.");
15+
options.addOption("d", "dest", true, "The destanation file/directory for converted file(s).");
16+
options.addOption("mo", "mode", true, "The processing file mode (xmltojson|jsontoxml).");
17+
}
18+
}
19+

0 commit comments

Comments
 (0)