ACCUMULO-1166 General cleanup for the instamo archetype that for the
1.4 series releases
Change dependency from 1.4.4-SNAPSHOT to 1.4.4. Remove a bunch of
in the pom. Only run one tserver in the unit test to make things run a
little bit faster. A log4j for test time. Also added some System.exit to
make sure the maven-exec-plugin doesn't inaccurately report failure on
the ShellExample.
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5080ddb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+.project
+.settings
+/target
diff --git a/pom.xml b/pom.xml
index d252019..19e0c4e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,78 +1,84 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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>org.apache.accumulo</groupId>
- <artifactId>instamo-archetype</artifactId>
- <version>1.4.4-SNAPSHOT</version>
- <packaging>maven-archetype</packaging>
- <name>instamo-archetype</name>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/accumulo/contrib/instamo-archetype/branches/1.4</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/accumulo/contrib/instamo-archetype/branches/1.4</developerConnection>
- <url>http://svn.apache.org/viewvc/accumulo/contrib/instamo-archetype/branches/1.4</url>
- </scm>
- <url>http://accumulo.apache.org</url>
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.2</version>
- </extension>
- </extensions>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.2.1</version>
- <configuration>
- <includePom>true</includePom>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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</groupId>
+ <artifactId>apache</artifactId>
+ <version>10</version>
+ </parent>
+
+ <groupId>org.apache.accumulo</groupId>
+ <artifactId>instamo-archetype</artifactId>
+ <version>1.4.4-SNAPSHOT</version>
+ <packaging>maven-archetype</packaging>
+ <name>instamo-archetype</name>
+ <scm>
+ <connection>scm:git:git://git.apache.org/accumulo-instamo-archetype.git</connection>
+ <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/accumulo-instamo-archetype.git</developerConnection>
+ <url>https://git-wip-us.apache.org/repos/asf?p=accumulo-instamo-archetype.git</url>
+ </scm>
+ <url>http://accumulo.apache.org</url>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.2</version>
+ </extension>
+ </extensions>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <configuration>
+ <includePom>true</includePom>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/src/main/resources/META-INF/maven/archetype-metadata.xml b/src/main/resources/META-INF/maven/archetype-metadata.xml
index 6f37215..0601ba1 100644
--- a/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -27,7 +27,7 @@
<defaultValue>instamo</defaultValue>
</requiredProperty>
<requiredProperty key="version">
- <defaultValue>1.0-SNAPSHOT</defaultValue>
+ <defaultValue>0.0.1-SNAPSHOT</defaultValue>
</requiredProperty>
<requiredProperty key="package">
<defaultValue>instamo</defaultValue>
diff --git a/src/main/resources/archetype-resources/pom.xml b/src/main/resources/archetype-resources/pom.xml
index a42f616..0a1fd93 100644
--- a/src/main/resources/archetype-resources/pom.xml
+++ b/src/main/resources/archetype-resources/pom.xml
@@ -25,8 +25,8 @@
<url>http://accumulo.apache.org</url>
<properties>
- <accumulo.version>1.4.4-SNAPSHOT</accumulo.version>
- <hadoop-one.version>1.0.4</hadoop-one.version>
+ <accumulo.version>1.4.4</accumulo.version>
+ <hadoop-one.version>1.2.1</hadoop-one.version>
<hadoop-two.version>2.0.2-alpha</hadoop-two.version>
<maclass>${package}.MapReduceExample</maclass>
</properties>
diff --git a/src/main/resources/archetype-resources/src/main/java/ShellExample.java b/src/main/resources/archetype-resources/src/main/java/ShellExample.java
index 6e96666..7c3406e 100644
--- a/src/main/resources/archetype-resources/src/main/java/ShellExample.java
+++ b/src/main/resources/archetype-resources/src/main/java/ShellExample.java
@@ -50,8 +50,10 @@
} catch (InterruptedException e) {
System.err.println("Error starting MiniAccumuloCluster: " + e.getMessage());
+ System.exit(1);
} catch (IOException e) {
System.err.println("Error starting MiniAccumuloCluster: " + e.getMessage());
+ System.exit(1);
} finally {
if (null != tempDir) {
tempDir.delete();
@@ -62,8 +64,10 @@
mac.stop();
} catch (InterruptedException e) {
System.err.println("Error stopping MiniAccumuloCluster: " + e.getMessage());
+ System.exit(1);
} catch (IOException e) {
System.err.println("Error stopping MiniAccumuloCluster: " + e.getMessage());
+ System.exit(1);
}
}
}
@@ -74,5 +78,7 @@
ShellExample shell = new ShellExample();
shell.run();
+
+ System.exit(0);
}
}
diff --git a/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java b/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
index 0d225c5..2c9cce1 100644
--- a/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
+++ b/src/main/resources/archetype-resources/src/test/java/ExampleAccumuloUnitTest.java
@@ -31,6 +31,8 @@
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.minicluster.MiniAccumuloCluster;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.log4j.Logger;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -42,6 +44,7 @@
*/
public class ExampleAccumuloUnitTest {
+ private static final Logger log = Logger.getLogger(ExampleAccumuloUnitTest.class);
public static TemporaryFolder folder = new TemporaryFolder();
@@ -52,7 +55,13 @@
folder.create();
- accumulo = new MiniAccumuloCluster(folder.getRoot(), "superSecret");
+ log.debug("Using " + folder.getRoot());
+
+ MiniAccumuloConfig config = new MiniAccumuloConfig(folder.getRoot(), "superSecret");
+ config.setNumTservers(1);
+
+
+ accumulo = new MiniAccumuloCluster(config);
accumulo.start();
@@ -101,7 +110,7 @@
Scanner scanner = conn.createScanner("foo", Constants.NO_AUTHS);
for (Entry<Key,Value> entry : scanner) {
- System.out.println(entry.getKey() + " " + entry.getValue());
+ log.debug(entry.getKey() + " " + entry.getValue());
}
//TODO use scanner to find common enemy ids between Alice and Bob, then
diff --git a/src/main/resources/archetype-resources/src/test/resources/log4j.properties b/src/main/resources/archetype-resources/src/test/resources/log4j.properties
new file mode 100644
index 0000000..e9f9124
--- /dev/null
+++ b/src/main/resources/archetype-resources/src/test/resources/log4j.properties
@@ -0,0 +1,29 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+
+# 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=INFO, CA
+log4j.appender.CA=org.apache.log4j.ConsoleAppender
+log4j.appender.CA.layout=org.apache.log4j.PatternLayout
+log4j.appender.CA.layout.ConversionPattern=[%t] %-5p %c %x - %m%n
+
+log4j.logger.org.apache.zookeeper=ERROR,CA
+log4j.logger.org.apache.accumulo.core.client.impl.ServerClient=ERROR,CA
+log4j.logger.org.apache.accumulo.core.util.shell.Shell.audit=WARN,CA
+log4j.logger.org.apache.commons.vfs2.impl.DefaultFileSystemManager=WARN,CA