You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/02/23 16:04:06 UTC
incubator-tinkerpop git commit: Added gremlin-archetypes and related
submodules.
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1085 [created] bb3bf09f5
Added gremlin-archetypes and related submodules.
Established the model for "examples" in TinkerPop using Maven archetypes. Provided two archetypes: gremlin-archetype-server and gremlin-archetype-tinkergraph.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/bb3bf09f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/bb3bf09f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/bb3bf09f
Branch: refs/heads/TINKERPOP-1085
Commit: bb3bf09f57ba2ceb40565f2f9cefa886718d241d
Parents: 6f27995
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Feb 23 10:01:15 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Feb 23 10:01:15 2016 -0500
----------------------------------------------------------------------
CHANGELOG.asciidoc | 3 +
.../src/reference/gremlin-applications.asciidoc | 22 +++++
.../upgrade/release-3.1.x-incubating.asciidoc | 15 +++-
.../gremlin-archetype-server/pom.xml | 59 ++++++++++++++
.../META-INF/maven/archetype-metadata.xml | 47 +++++++++++
.../archetype-resources/README.asciidoc | 67 ++++++++++++++++
.../archetype-resources/conf/log4j.properties | 21 +++++
.../conf/tinkergraph-empty.properties | 18 +++++
.../main/resources/archetype-resources/pom.xml | 80 +++++++++++++++++++
.../scripts/generate-modern.groovy | 33 ++++++++
.../archetype-resources/src/main/java/App.java | 35 ++++++++
.../src/main/java/Service.java | 70 ++++++++++++++++
.../src/main/resources/gremlin-server.yaml | 45 +++++++++++
.../src/test/java/ServiceTest.java | 84 ++++++++++++++++++++
.../projects/standard/archetype.properties | 21 +++++
.../test/resources/projects/standard/goal.txt | 1 +
.../gremlin-archetype-tinkergraph/pom.xml | 59 ++++++++++++++
.../META-INF/maven/archetype-metadata.xml | 38 +++++++++
.../archetype-resources/README.asciidoc | 35 ++++++++
.../main/resources/archetype-resources/pom.xml | 58 ++++++++++++++
.../archetype-resources/src/main/java/App.java | 78 ++++++++++++++++++
.../src/test/java/AppTest.java | 40 ++++++++++
.../projects/standard/archetype.properties | 21 +++++
.../test/resources/projects/standard/goal.txt | 1 +
gremlin-archetype/pom.xml | 70 ++++++++++++++++
pom.xml | 2 +
26 files changed, 1022 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index b35efcb..67965cf 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,9 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.1.2 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Added the `gremlin-archetype-driver` archetype that demonstrates
+* Added the `gremlin-archetype-tinkergraph` archetype that demonstrates a basic project that uses TinkerGraph.
+* Added `gremlin-archetype` module to house TinkerPop "examples".
* Fixed a bug where multiple "close" requests were being sent by the driver on `Client.close()`.
* Fixed an `Property` attach bug that shows up in serialization-based `GraphComputer` implementations.
* Fixed a pom.xml bug where Gremlin Console/Server were not pulling the latest Neo4j 2.3.2.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 43608b1..02bf1f0 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1880,3 +1880,25 @@ The following shows the output for `HadoopGraph`:
----
describeGraph(HadoopGraph)
----
+
+[[gremlin-archetypes]]
+Gremlin Archetypes
+==================
+
+TinkerPop has a number of link:https://maven.apache.org/guides/introduction/introduction-to-archetypes.html[Maven archetypes],
+which provide example project templates to quickly get started with TinkerPop. The available archetypes are as follows:
+
+* `gremlin-archetype-server` - An example project that demonstrates the basic structure of a
+<<gremlin-server,Gremlin Server>> project, how to connect with the Gremlin Driver, and how to embed Gremlin Server in
+a testing framework.
+* `gremlin-archetype-tinkergraph` - A basic example of how to structure a TinkerPop project with Maven.
+
+You can use Maven to generate these example projects with a command like:
+
+[source,shell]
+$ mvn archetype:generate -DarchetypeGroupId=org.apache.tinkerpop -DarchetypeArtifactId=gremlin-archetype-server
+ -DarchetypeVersion=3.1.2-incubating -DgroupId=com.my -DartifactId=app
+
+This command will generate a new Maven project in a directory called "app" with a `pom.xml` specifying a `groupId` of
+`com.my`. Please see the `README.asciidoc` in the root of each generated project for information on how to build and
+execute it.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/docs/src/upgrade/release-3.1.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.1.x-incubating.asciidoc b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
index 1b7425c..9776058 100644
--- a/docs/src/upgrade/release-3.1.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.1.x-incubating.asciidoc
@@ -27,11 +27,24 @@ TinkerPop 3.1.2
*Release Date: NOT OFFICIALLY RELEASED YET*
-Please see the link:https://github.com/apache/incubator-tinkerpop/blob/3.1.1-incubating/CHANGELOG.asciidoc#tinkerpop-312-release-date-XXXXXXXXXXXXXXXXXXXXXXXXXX[changelog] for a complete list of all the modifications that are part of this release.
+Please see the link:https://github.com/apache/incubator-tinkerpop/blob/3.1.2-incubating/CHANGELOG.asciidoc#tinkerpop-312-release-date-XXXXXXXXXXXXXXXXXXXXXXXXXX[changelog] for a complete list of all the modifications that are part of this release.
Upgrading for Users
~~~~~~~~~~~~~~~~~~~
+TinkerPop Archetypes
+^^^^^^^^^^^^^^^^^^^^
+
+TinkerPop now offers link:https://maven.apache.org/guides/introduction/introduction-to-archetypes.html[Maven archetypes],
+which provide example project templates to quickly get started with TinkerPop. The available archetypes are as follows:
+
+* `gremlin-archetype-server` - An example project that demonstrates the basic structure of a Gremlin Server project,
+how to connect with the Gremlin Driver, and how to embed Gremlin Server in a testing framework.
+* `gremlin-archetype-tinkergraph` - A basic example of how to structure a TinkerPop project with Maven.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1085[TINKERPOP-1085],
+link:http://tinkerpop.apache.org/docs/3.1.2-incubating/reference/#gremlin-archetypes[Reference Documentation - Archetypes]
+
Session Transaction Management
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/pom.xml b/gremlin-archetype/gremlin-archetype-server/pom.xml
new file mode 100644
index 0000000..c5efbf7
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/pom.xml
@@ -0,0 +1,59 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>gremlin-archetype</artifactId>
+ <version>3.1.2-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gremlin-archetype-server</artifactId>
+ <name>Apache TinkerPop :: Archetype - Server</name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ </plugins>
+
+ <!-- apply variable substitution on the following files using variables from this pom -->
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>archetype-resources/pom.xml</include>
+ <include>archetype-resources/README.asciidoc</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>archetype-resources/pom.xml</exclude>
+ <exclude>archetype-resources/README.asciidoc</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml b/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..a6c9d46
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,47 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="gremlin-archetype-tinkergraph"
+ xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <fileSets>
+ <fileSet filtered="true">
+ <directory></directory>
+ <includes>
+ <include>README.asciidoc</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet filtered="true">
+ <directory>conf/</directory>
+ </fileSet>
+ <fileSet filtered="true">
+ <directory>scripts/</directory>
+ </fileSet>
+ <fileSet filtered="true" packaged="true">
+ <directory>src/main/java</directory>
+ </fileSet>
+ <fileSet filtered="true" packaged="true">
+ <directory>src/main/resources</directory>
+ </fileSet>
+ <fileSet filtered="true" packaged="true">
+ <directory>src/test/java</directory>
+ </fileSet>
+ </fileSets>
+
+</archetype-descriptor>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc
new file mode 100644
index 0000000..42f369d
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/README.asciidoc
@@ -0,0 +1,67 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+////
+Gremlin Server Application
+==========================
+
+This is a starter project that demonstrates how a basic
+link:http://tinkerpop.apache.org/docs/${project.version}/reference/#gremlin-server[Gremlin Server] project is structured
+with Maven. This project demonstrates how to connect to Gremlin Server through Java using the
+link:http://tinkerpop.apache.org/docs/${project.version}/reference/#connecting-via-java[Gremlin Driver] that is
+distributed by TinkerPop.
+
+Prerequisites
+-------------
+
+* Java 8 Update 40+
+* link:https://maven.apache.org/[Maven 3.x]
+* Gremlin Server is link:http://archive.apache.org/dist/incubator/tinkerpop/[downloaded] and unpackaged
+
+Building and Running
+--------------------
+
+Start Gremlin Server in the directory it was unpackaged and specify usage of the "modern" graph configuration:
+
+[source,text]
+$ bin/gremlin-server.sh conf/gremlin-server-modern.yaml
+[INFO] GremlinServer -
+ \,,,/
+ (o o)
+-----oOOo-(3)-oOOo-----
+
+[INFO] GremlinServer - Configuring Gremlin Server from conf/gremlin-server-modern.yaml
+[INFO] MetricManager - Configured Metrics Slf4jReporter configured with interval=180000ms and loggerName=org.apache.tinkerpop.gremlin.server.Settings$Slf4jReporterMetrics
+[INFO] Graphs - Graph [graph] was successfully configured via [conf/tinkergraph-empty.properties].
+[INFO] ServerGremlinExecutor - Initialized Gremlin thread pool. Threads in pool named with pattern gremlin-*
+[INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
+[INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with scripts/generate-modern.groovy
+[INFO] ServerGremlinExecutor - Initialized GremlinExecutor and configured ScriptEngines.
+[INFO] ServerGremlinExecutor - A GraphTraversalSource is now bound to [g] with graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
+[INFO] OpLoader - Adding the standard OpProcessor.
+[INFO] OpLoader - Adding the control OpProcessor.
+[INFO] OpLoader - Adding the session OpProcessor.
+[INFO] GremlinServer - Executing start up LifeCycleHook
+[INFO] Logger$info - Loading 'modern' graph data.
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] AbstractChannelizer - Configured application/vnd.gremlin-v1.0+gryo-stringd with org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0
+[INFO] GremlinServer$1 - Gremlin Server configured with worker thread pool of 1, gremlin pool of 8 and boss thread pool of 1.
+[INFO] GremlinServer$1 - Channel started at port 8182.
+
+Build and run this project as follows:
+
+[source,text]
+mvn clean package
+mvn exec:java -Dexec.mainClass="${package}.App"
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties
new file mode 100644
index 0000000..ef436fe
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/log4j.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+log4j.rootLogger=WARN, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] %C - %m%n
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/tinkergraph-empty.properties
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/tinkergraph-empty.properties b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/tinkergraph-empty.properties
new file mode 100644
index 0000000..e09a13d
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/conf/tinkergraph-empty.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+gremlin.graph=org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
+gremlin.tinkergraph.vertexIdManager=LONG
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..5c47aea
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,80 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>\${groupId}</groupId>
+ <artifactId>\${artifactId}</artifactId>
+ <version>\${version}</version>
+
+ <name>Getting started with Gremlin Server</name>
+
+ <packaging>jar</packaging>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>gremlin-driver</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>gremlin-server</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <!-- TinkerPop3 requires Java 8 -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.17</version>
+ <configuration>
+ <systemPropertyVariables>
+ <log4j.configuration>file:conf/log4j.properties</log4j.configuration>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/scripts/generate-modern.groovy
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/scripts/generate-modern.groovy b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/scripts/generate-modern.groovy
new file mode 100644
index 0000000..23b4a61
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/scripts/generate-modern.groovy
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// an init script that returns a Map allows explicit setting of global bindings.
+def globals = [:]
+
+// Generates the modern graph into an "empty" TinkerGraph via LifeCycleHook.
+// Note that the name of the key in the "global" map is unimportant.
+globals << [hook : [
+ onStartUp: { ctx ->
+ ctx.logger.info("Loading 'modern' graph data.")
+ TinkerFactory.generateModern(graph)
+ }
+] as LifeCycleHook]
+
+// define the default TraversalSource to bind queries to - this one will be named "g".
+globals << [g : graph.traversal()]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java
new file mode 100644
index 0000000..d1761c7
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/App.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import org.apache.tinkerpop.gremlin.driver.Result;
+
+public class App {
+
+ public static void main(String[] args) throws Exception {
+ Service service = Service.getInstance();
+ try {
+ service.findCreatorsOfSoftware("lop").iterator().forEachRemaining(r -> System.out.println(r));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ } finally {
+ service.close();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
new file mode 100644
index 0000000..b2e9de6
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/java/Service.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import org.apache.tinkerpop.gremlin.driver.Cluster;
+import org.apache.tinkerpop.gremlin.driver.Client;
+import org.apache.tinkerpop.gremlin.driver.Result;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Service implements AutoCloseable {
+
+ /**
+ * There typically needs to be only one Cluster instance in an application.
+ */
+ private final Cluster cluster = Cluster.open();
+
+ /**
+ * Use the Cluster instance to construct different Client instances (e.g. one for sessionless communication
+ * and one or more sessions). A sessionless Client should be thread-safe and typically no more than one is
+ * needed unless there is some need to divide connection pools across multiple Client instances. In this case
+ * there is just a single sessionless Client instance used for the entire App.
+ */
+ private final Client client = cluster.connect();
+
+ /**
+ * Create Service as a singleton given the simplicity of App.
+ */
+ private static final Service INSTANCE = new Service();
+
+ private Service() {}
+
+ public static Service getInstance() {
+ return INSTANCE;
+ }
+
+ public List<String> findCreatorsOfSoftware(String softwareName) throws Exception {
+ // it is very important from a performance perspective to parameterize queries
+ Map params = new HashMap();
+ params.put("n", softwareName);
+
+ return client.submit("g.V().hasLabel('software').has('name',n).in('created').values('name')", params)
+ .all().get().stream().map(r -> r.getString()).collect(Collectors.toList());
+ }
+
+ @Override
+ public void close() throws Exception {
+ client.close();
+ cluster.close();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml
new file mode 100644
index 0000000..5744d29
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/main/resources/gremlin-server.yaml
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+host: localhost
+port: 8182
+threadPoolWorker: 1
+gremlinPool: 8
+scriptEvaluationTimeout: 30000
+serializedResponseTimeout: 30000
+graphs: {
+ graph: conf/tinkergraph-empty.properties}
+plugins:
+ - tinkerpop.tinkergraph
+scriptEngines: {
+ gremlin-groovy: {
+ imports: [java.lang.Math],
+ staticImports: [java.lang.Math.PI],
+ scripts: [scripts/generate-modern.groovy]}}
+serializers:
+ - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo
+ - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }} # application/vnd.gremlin-v1.0+gryo-stringd
+metrics: {
+ slf4jReporter: {enabled: true, interval: 180000}}
+strictTransactionManagement: false
+threadPoolBoss: 1
+maxInitialLineLength: 4096
+maxHeaderSize: 8192
+maxChunkSize: 8192
+maxContentLength: 65536
+maxAccumulationBufferComponents: 1024
+resultIterationBatchSize: 64
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
new file mode 100644
index 0000000..6f7d5c3
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/java/ServiceTest.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import org.apache.tinkerpop.gremlin.server.GremlinServer;
+import org.apache.tinkerpop.gremlin.server.Settings;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Arrays;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.hamcrest.CoreMatchers.is;
+
+/**
+ * Basic test class that demonstrates how to start and stop an embedded Gremlin Server instance in a test. Note that
+ * the server instance is not started or stopped in a thread-safe manner, but typically this is acceptable for most
+ * testing use cases.
+ */
+public class ServiceTest {
+ private GremlinServer server;
+
+ private static Service service = Service.getInstance();
+
+ @Before
+ public void setUp() throws Exception {
+ startServer();
+ }
+
+ /**
+ * Starts a new instance of Gremlin Server.
+ */
+ public void startServer() throws Exception {
+ final InputStream stream = ServiceTest.class.getResourceAsStream("gremlin-server.yaml");
+ this.server = new GremlinServer(Settings.read(stream));
+
+ server.start().join();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ stopServer();
+ }
+
+ /**
+ * Stops a current instance of Gremlin Server.
+ */
+ public void stopServer() throws Exception {
+ server.stop().join();
+ }
+
+ @AfterClass
+ public static void tearDownCase() throws Exception {
+ service.close();
+ }
+
+ @Test
+ public void shouldCreateGraph() throws Exception {
+ List<String> result = service.findCreatorsOfSoftware("lop");
+ assertThat(result, is(Arrays.asList("marko", "josh", "peter")));
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/test/resources/projects/standard/archetype.properties
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/test/resources/projects/standard/archetype.properties b/gremlin-archetype/gremlin-archetype-server/src/test/resources/projects/standard/archetype.properties
new file mode 100644
index 0000000..26067b7
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/test/resources/projects/standard/archetype.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+groupId=org.apache.tinkerpop
+artifactId=gremlin-archetype-server
+package=com.test.example
+version=1.0.0-SNAPSHOT
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-server/src/test/resources/projects/standard/goal.txt
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/test/resources/projects/standard/goal.txt b/gremlin-archetype/gremlin-archetype-server/src/test/resources/projects/standard/goal.txt
new file mode 100644
index 0000000..4a1a71d
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-server/src/test/resources/projects/standard/goal.txt
@@ -0,0 +1 @@
+verify
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
new file mode 100644
index 0000000..078071d
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/pom.xml
@@ -0,0 +1,59 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>gremlin-archetype</artifactId>
+ <version>3.1.2-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gremlin-archetype-tinkergraph</artifactId>
+ <name>Apache TinkerPop :: Archetype - TinkerGraph</name>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ </plugins>
+
+ <!-- apply variable substitution on the following files using variables from this pom -->
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>archetype-resources/pom.xml</include>
+ <include>archetype-resources/README.asciidoc</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <excludes>
+ <exclude>archetype-resources/pom.xml</exclude>
+ <exclude>archetype-resources/README.asciidoc</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/META-INF/maven/archetype-metadata.xml b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..a159ee3
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,38 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="gremlin-archetype-tinkergraph"
+ xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <fileSets>
+ <fileSet filtered="true">
+ <directory></directory>
+ <includes>
+ <include>README.asciidoc</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet filtered="true" packaged="true">
+ <directory>src/main/java</directory>
+ </fileSet>
+ <fileSet filtered="true" packaged="true">
+ <directory>src/test/java</directory>
+ </fileSet>
+ </fileSets>
+
+</archetype-descriptor>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/README.asciidoc
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/README.asciidoc b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/README.asciidoc
new file mode 100644
index 0000000..59d5aff
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/README.asciidoc
@@ -0,0 +1,35 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+////
+Simple TinkerPop Application
+============================
+
+This is a simple starter project that demonstrates how a basic TinkerPop project is structured with Maven. This project
+uses link:http://tinkerpop.apache.org/docs/${project.version}/reference/#tinkergraph-gremlin[TinkerGraph] as an
+embedded graph database, loads it with some data and then executes a shortest path calculation, printing the results.
+
+Prerequisites
+-------------
+
+* Java 8 Update 40+
+* link:https://maven.apache.org/[Maven 3.x]
+
+Building and Running
+--------------------
+
+[source,text]
+mvn clean package
+mvn exec:java -Dexec.mainClass="${package}.App"
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..271f9dd
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,58 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>\${groupId}</groupId>
+ <artifactId>\${artifactId}</artifactId>
+ <version>\${version}</version>
+
+ <name>Getting started with TinkerGraph</name>
+
+ <packaging>jar</packaging>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>tinkergraph-gremlin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <!-- TinkerPop3 requires Java 8 -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/src/main/java/App.java
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/src/main/java/App.java b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/src/main/java/App.java
new file mode 100644
index 0000000..dd97224
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/src/main/java/App.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+
+public class App {
+
+ public static void main(String[] args) {
+ // Create a new TinkerGraph and load some test data. The Graph instance is typically named "graph" as a
+ // variable name. You will see this pattern consistently in TinkerPop documentation, the mailing list, etc.
+ Graph graph = TinkerGraph.open();
+ loadData(graph);
+
+ // Create a GraphTraversalSource instance that is used to query the data in the Graph instance. This variable
+ // is typically denoted as "g". In TinkerPop documentation you can always count on references to "g" as
+ // being a object of this type.
+ GraphTraversalSource g = graph.traversal();
+
+ Vertex fromNode = findByName(g, "marko");
+ Vertex toNode = findByName(g, "peter");
+
+ List list = calculateShortestPathBetween(g, fromNode, toNode);
+ System.out.println(list.toString());
+ System.exit(0);
+ }
+
+ public static Vertex findByName(GraphTraversalSource g, String name) {
+ return g.V().has("name", name).next();
+ }
+
+ public static List calculateShortestPathBetween(GraphTraversalSource g, Vertex fromNode, Vertex toNode) {
+ ArrayList list = new ArrayList();
+ g.V(fromNode).repeat(both().simplePath()).until(is(toNode)).limit(1).path().fill(list);
+ return list;
+ }
+
+ public static void loadData(Graph graph) {
+ // see org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory.generateModern()
+ final Vertex marko = graph.addVertex(T.id, 1, T.label, "person", "name", "marko", "age", 29);
+ final Vertex vadas = graph.addVertex(T.id, 2, T.label, "person", "name", "vadas", "age", 27);
+ final Vertex lop = graph.addVertex(T.id, 3, T.label, "software", "name", "lop", "lang", "java");
+ final Vertex josh = graph.addVertex(T.id, 4, T.label, "person", "name", "josh", "age", 32);
+ final Vertex ripple = graph.addVertex(T.id, 5, T.label, "software", "name", "ripple", "lang", "java");
+ final Vertex peter = graph.addVertex(T.id, 6, T.label, "person", "name", "peter", "age", 35);
+ marko.addEdge("knows", vadas, T.id, 7, "weight", 0.5d);
+ marko.addEdge("knows", josh, T.id, 8, "weight", 1.0d);
+ marko.addEdge("created", lop, T.id, 9, "weight", 0.4d);
+ josh.addEdge("created", ripple, T.id, 10, "weight", 1.0d);
+ josh.addEdge("created", lop, T.id, 11, "weight", 0.4d);
+ peter.addEdge("created", lop, T.id, 12, "weight", 0.2d);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/src/test/java/AppTest.java
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/src/test/java/AppTest.java b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/src/test/java/AppTest.java
new file mode 100644
index 0000000..7b400b7
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/src/main/resources/archetype-resources/src/test/java/AppTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class AppTest {
+
+ @Test
+ public void shouldCreateGraph() {
+ TinkerGraph graph = TinkerGraph.open();
+ App.loadData(graph);
+
+ GraphTraversalSource g = graph.traversal();
+
+ assertEquals(6, g.V().count().next().intValue());
+ assertEquals(6, g.E().count().next().intValue());
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-tinkergraph/src/test/resources/projects/standard/archetype.properties
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/src/test/resources/projects/standard/archetype.properties b/gremlin-archetype/gremlin-archetype-tinkergraph/src/test/resources/projects/standard/archetype.properties
new file mode 100644
index 0000000..9c3e51c
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/src/test/resources/projects/standard/archetype.properties
@@ -0,0 +1,21 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+groupId=org.apache.tinkerpop
+artifactId=gremlin-archetype-tinkergraph
+package=com.test.example
+version=1.0.0-SNAPSHOT
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/gremlin-archetype-tinkergraph/src/test/resources/projects/standard/goal.txt
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-tinkergraph/src/test/resources/projects/standard/goal.txt b/gremlin-archetype/gremlin-archetype-tinkergraph/src/test/resources/projects/standard/goal.txt
new file mode 100644
index 0000000..4a1a71d
--- /dev/null
+++ b/gremlin-archetype/gremlin-archetype-tinkergraph/src/test/resources/projects/standard/goal.txt
@@ -0,0 +1 @@
+verify
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/gremlin-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/pom.xml b/gremlin-archetype/pom.xml
new file mode 100644
index 0000000..fdfe35f
--- /dev/null
+++ b/gremlin-archetype/pom.xml
@@ -0,0 +1,70 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>tinkerpop</artifactId>
+ <groupId>org.apache.tinkerpop</groupId>
+ <version>3.1.2-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gremlin-archetype</artifactId>
+ <name>Apache TinkerPop :: Gremlin Archetype</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>gremlin-archetype-tinkergraph</module>
+ <module>gremlin-archetype-server</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- without this configuration -DskipTests is useless -->
+ <skip>${skipTests}</skip>
+ </configuration>
+ </plugin>
+
+ <!--
+ Variables are applied in two separate rounds. The first round applies variables from this pom.xml
+ and the second round removes escaping from variables so that they can become variables during
+ archetype generation
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <configuration>
+ <escapeString>\</escapeString>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb3bf09f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 311ddad..a8f1cfa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -118,6 +118,7 @@ limitations under the License.
<module>gremlin-driver</module>
<module>gremlin-console</module>
<module>gremlin-server</module>
+ <module>gremlin-archetype</module>
</modules>
<scm>
<connection>scm:git:git@git-wip-us.apache.org:repos/asf/incubator-tinkerpop.git</connection>
@@ -277,6 +278,7 @@ limitations under the License.
<exclude>**/*.json</exclude>
<exclude>**/*.xml</exclude>
<exclude>**/*.ldjson</exclude>
+ <exclude>**/goal.txt</exclude>
<exclude>**/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/script/*.txt</exclude>
<exclude>**/src/main/resources/META-INF/services/**</exclude>
<exclude>**/src/main/ext/**</exclude>