Skip to content

Commit

Permalink
assembly *.tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
downgoon committed May 4, 2017
1 parent 8312ae8 commit 78a8860
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 6 deletions.
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,30 @@ automatically generate a RESTful API of your database (sqlite3 or mysql) in runt

### Install and start

run ``AutoRestMain.java``
download [autorest4db-0.1.1.tar.gz](https://github.com/downgoon/autorest4db/releases/download/0.1.1/autorest4db-0.1.1.tar.gz) and decompress it

``` bash
$ wget autorest4db-0.1.1.tar.gz
$ tar zxvf autorest4db-0.1.1.tar.gz
$ cd autorest4db-0.1.1
$ bin/autorest4db start
```

in IDE (such as Eclipse), just run ``AutoRestMain.java``

BTW, how to build and package ?

``` bash
git clone https://github.com/downgoon/autorest4db.git
cd autorest4db
mvn clean package
```

``autorest4db-0.1.1.tar.gz`` will be generated in the ``target`` directory.


>REQUIREMENT
> - JDK8 +
### Create dababase and tables

Expand Down Expand Up @@ -125,7 +148,7 @@ Content-Length: 48

- **update entity**

update employee=99
update employee=99

``` bash
$ curl -X PUT -i -d '{"name": "wangyiV2", "age": 32 }' -H "Content-Type: application/json" http://localhost:8080/dbapi/default/employee/99
Expand Down Expand Up @@ -156,7 +179,7 @@ Not Found%

- **composite keys**

```
``` bash
$ curl -i -X GET http://localhost:8080/dbapi/default/friend
HTTP/1.1 200 OK
Server: autorest4db
Expand All @@ -175,4 +198,3 @@ Content-Length: 42
```

the composite key value '1001-1032' would be split into '1001' assigned to 'user_id' and '1032' assigned to 'frie_id'.

134 changes: 132 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,35 @@

<groupId>io.downgoon</groupId>
<artifactId>autorest4db</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>
<packaging>jar</packaging>

<name>autorest4db</name>
<url>http://maven.apache.org</url>
<description>
automatically generate a RESTful API of your database (sqlite3 or mysql) in runtime.</description>
<url>https://github.com/downgoon/autorest4db</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<connection>scm:git:[email protected]:downgoon/autorest4db.git</connection>
<developerConnection>scm:git:[email protected]:downgoon/autorest4db.git</developerConnection>
<url>http://github.com/downgoon/autorest4db</url>
<tag>autorest4db-0.1.1</tag>
</scm>

<developers>
<developer>
<id>downgoon</id>
<name>downgoon</name>
<email>[email protected]</email>
</developer>
</developers>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -99,6 +123,112 @@
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<configurationDirectory>conf</configurationDirectory>
<includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
<repositoryLayout>flat</repositoryLayout>
<useWildcardClassPath>true</useWildcardClassPath>
<daemons>
<daemon>
<id>${project.name}</id>
<mainClass>io.downgoon.autorest4db.AutoRestMain</mainClass>
<commandLineArguments>
<commandLineArgument>start</commandLineArgument>
</commandLineArguments>
<platforms>
<platform>jsw</platform>
</platforms>
<jvmSettings>

<maxStackSize>128</maxStackSize>
<systemProperties>
<systemProperty>APP_HOME=.</systemProperty>
</systemProperties>

<extraArguments>
<extraArgument>-server</extraArgument>
<extraArgument>-XX:MaxPermSize=64M</extraArgument>
<extraArgument>-Xms1G</extraArgument>
<extraArgument>-Xmx2G</extraArgument>
</extraArguments>

</jvmSettings>
<generatorConfigurations>
<generatorConfiguration>
<generator>jsw</generator>
<includes>
<include>aix-ppc-32</include>
<include>aix-ppc-64</include>
<include>hpux-parisc-64</include>
<include>linux-x86-32</include>
<include>linux-x86-64</include>
<include>linux-ppc-64</include>
<include>macosx-ppc-32</include>
<include>macosx-x86-universal-32</include>
<include>macosx-universal-32</include>
<include>macosx-universal-64</include>
<include>solaris-sparc-32</include>
<include>solaris-sparc-64</include>
<include>solaris-x86-32</include>
<include>windows-x86-32</include>
<include>windows-x86-64</include>
</includes>

<configuration>
<property>
<name>configuration.directory.in.classpath.first</name>
<value>conf</value>
</property>
<property>
<name>set.default.REPO_DIR</name>
<value>lib</value>
</property>
<property>
<name>wrapper.logfile</name>
<value>logs/${project.name}.log</value>
</property>
</configuration>

</generatorConfiguration>
</generatorConfigurations>
</daemon>

</daemons>
</configuration>
<executions>
<execution>
<id>generate-jsw</id>
<phase>package</phase>
<goals>
<goal>generate-daemons</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- package tar.gz -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
71 changes: 71 additions & 0 deletions src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

<id></id>

<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>tar.gz</format>
</formats>

<fileSets>

<fileSet>
<directory>target/generated-resources/appassembler/jsw/${project.name}/lib
</directory>
<outputDirectory>${project.build.finalName}/lib</outputDirectory>
<fileMode>0755</fileMode>
<includes>
<include>*.jar</include>
<include>libwrapper-*</include>
</includes>
</fileSet>
<fileSet>
<directory>target/generated-resources/appassembler/jsw/${project.name}/conf
</directory>
<outputDirectory>${project.build.finalName}/conf</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
<fileSet>
<directory>target/generated-resources/appassembler/jsw/${project.name}/bin
</directory>
<outputDirectory>${project.build.finalName}/bin</outputDirectory>
<fileMode>0755</fileMode>
<includes>
<include>*</include>
</includes>
</fileSet>


<fileSet>
<directory>src/main/resources</directory>
<outputDirectory>${project.build.finalName}/conf</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>

<fileSet>
<directory>src/main/assembly/logs</directory>
<outputDirectory>${project.build.finalName}/logs</outputDirectory>
<excludes>
<exclude>*</exclude>
</excludes>
</fileSet>

<fileSet>
<directory>${basedir}</directory>
<outputDirectory>${project.build.finalName}</outputDirectory>
<includes>
<include>README.md</include>
<include>default.sql</include>
</includes>
</fileSet>

</fileSets>

</assembly>

0 comments on commit 78a8860

Please sign in to comment.