Revision: ba1c850dbe32
Author:   Jean Deruelle <[email protected]>
Date:     Tue May  1 02:30:43 2012
Log:      initial commit of sip servlets application maven archetype

http://code.google.com/p/sipservlets/source/detail?r=ba1c850dbe32&repo=archetypes

Added:
 /.gitignore
 /pom.xml
 /src/main/resources/META-INF/maven/archetype-metadata.xml
 /src/main/resources/archetype-resources/dar/mobicents-dar.properties
 /src/main/resources/archetype-resources/pom.xml
 /src/main/resources/archetype-resources/src/main/java/HelloSipWorld.java
 /src/main/resources/archetype-resources/src/main/sipapp/WEB-INF/sip.xml
 /src/main/resources/archetype-resources/src/main/sipapp/WEB-INF/web.xml
 /src/main/resources/archetype-resources/src/main/sipapp/index.jsp
 /src/test/resources/projects/basic/archetype.properties
 /src/test/resources/projects/basic/goal.txt

=======================================
--- /dev/null
+++ /.gitignore Tue May  1 02:30:43 2012
@@ -0,0 +1,51 @@
+# ignore .svn metadata files
+.svn
+# ignore Maven generated target folders
+~
+target
+classes
+*.zip
+# ignore eclipse files
+#.project
+#.classpath
+.settings
+.metadata
+# ignore IDEA files
+*.iml
+*.ipr
+*.iws
+.idea
+# ignore NetBeans files
+nbactions.xml
+nb-configuration.xml
+catalog.xml
+#
+maven-ant-tasks.jar
+test-output
+transaction.log
+# vim files
+*.swp
+/.gitk-tmp.*
+atlassian-ide-plugin.xml
+# temp files
+*~
+# maven versions plugin
+pom.xml.versionsBackup
+# hprof dumps
+/*.hprof
+# ignore 'randomly' strewn around logs
+server.log
+*.log
+# ignore java crashes
+hs_err_pid*.log
+# H2 databases produced by tests
+*.h2.db
+# JBoss transaction generated files
+PutObjectStoreDirHere
+# ignore mvn-rpmbuild repo
+/.m2
+
+#ignore autogenerate src doco folder
+docs/sources-mobicents/src/
+docs/sources-telscale/src/
+
=======================================
--- /dev/null
+++ /pom.xml    Tue May  1 02:30:43 2012
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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.mobicents.servlet.sip.archetypes</groupId>
+  <artifactId>maven-archetype-sipapp</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>maven-archetype</packaging>
+
+  <name>SIP Servlets Application Archetype</name>
+  <url>https://code.google.com/p/sipservlets.archetypes</url>
+  <description>
+ Archetype providing a default layout to start building SIP Servlets Applications.
+  </description>
+
+  <developers>
+       <developer>
+               <id>jean.deruelle</id>
+               <name>Jean Deruelle</name>
+               <email>[email protected]</email>
+               <organization>TeleStax, Inc</organization>
+               <organizationUrl>http://www.telestax.com/</organizationUrl>
+               <roles>
+                       <role>SIP Servlets Project Lead</role>
+               </roles>
+               <timezone>+1</timezone>
+       </developer>
+  </developers>
+  <licenses>
+       <license>
+               <name>GNU LESSER GENERAL PUBLIC LICENSE</name>
+               <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
+               <distribution>repo</distribution>
+       </license>
+  </licenses>
+
+    <scm>
+ <connection>scm:git:https://code.google.com/p/sipservlets.archetypes/</connection> + <developerConnection>scm:git:https://code.google.com/p/sipservlets.archetypes/</developerConnection>
+       <url>https://code.google.com/p/sipservlets.archetypes/</url>
+    </scm>
+
+    <distributionManagement>
+           <repository>
+             <id>mobicents-releases-repository</id>
+             <name>Mobicents Releases Repository</name>
+ <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
+           </repository>
+           <snapshotRepository>
+             <id>mobicents-snapshots-repository</id>
+             <name>Mobicents Snapshots Repository</name>
+             <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+           </snapshotRepository>
+         </distributionManagement>
+
+       <profiles>
+               <profile>
+                      <id>release-sign-artifacts</id>
+                      <activation>
+                        <property>
+                          <name>performRelease</name>
+                          <value>true</value>
+                        </property>
+                      </activation>
+                      <build>
+                        <plugins>
+                          <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-gpg-plugin</artifactId>
+                            <executions>
+                              <execution>
+                                <id>sign-artifacts</id>
+                                <phase>install</phase>
+                                <goals>
+                                  <goal>sign</goal>
+                                </goals>
+                              </execution>
+                            </executions>
+                          </plugin>
+                        </plugins>
+                      </build>
+                    </profile>
+       </profiles>
+
+    <repositories>
+               <repository>
+                         <id>mobicents-public-repository-group</id>
+                         <name>Mobicens Public Maven Repository Group</name>
+                         
<url>https://oss.sonatype.org/content/groups/public</url>
+                         <layout>default</layout>
+                         <releases>
+                           <enabled>true</enabled>
+                           <updatePolicy>never</updatePolicy>
+                         </releases>
+                         <snapshots>
+                           <enabled>true</enabled>
+                           <updatePolicy>never</updatePolicy>
+                         </snapshots>
+               </repository>
+               <repository>
+                 <id>jboss-public-repository-group</id>
+                 <name>JBoss Public Maven Repository Group</name>
+                 
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
+                 <layout>default</layout>
+                 <releases>
+                   <enabled>true</enabled>
+                   <updatePolicy>never</updatePolicy>
+                 </releases>
+                 <snapshots>
+                   <enabled>true</enabled>
+                   <updatePolicy>never</updatePolicy>
+                 </snapshots>
+               </repository>
+       </repositories>
+
+    <pluginRepositories>
+       <pluginRepository>
+                 <id>mobicents-public-repository-group</id>
+                 <name>Mobicens Public Maven Repository Group</name>
+                 <url>https://oss.sonatype.org/content/groups/public</url>
+                 <layout>default</layout>
+                 <releases>
+                   <enabled>true</enabled>
+                   <updatePolicy>never</updatePolicy>
+                 </releases>
+                 <snapshots>
+                   <enabled>true</enabled>
+                   <updatePolicy>never</updatePolicy>
+                 </snapshots>
+       </pluginRepository>
+        <pluginRepository>
+            <id>jboss-public-repository-group</id>
+            <name>JBoss Public Repository Group</name>
+ <url>http://repository.jboss.org/nexus/content/groups/public/</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
+
+    <build>
+       <extensions>
+      <extension>
+        <groupId>org.apache.maven.archetype</groupId>
+        <artifactId>archetype-packaging</artifactId>
+        <version>2.2</version>
+      </extension>
+    </extensions>
+        <pluginManagement>
+            <plugins>
+               <plugin>
+                 <artifactId>maven-archetype-plugin</artifactId>
+                 <version>2.2</version>
+               </plugin>
+                <plugin>
+                    <artifactId>maven-enforcer-plugin</artifactId>
+                    <version>1.0</version>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>enforce</goal>
+                            </goals>
+                            <inherited>true</inherited>
+                            <configuration>
+                                <rules>
+                                    <requireJavaVersion>
+                                        <version>[1.6.0,)</version>
+                                    </requireJavaVersion>
+                                    <requireMavenVersion>
+                                        <version>[3.0.3,)</version>
+                                    </requireMavenVersion>
+                                </rules>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-source-plugin</artifactId>
+                    <version>2.1.2</version>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>jar</goal>
+                                <goal>test-jar</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.jboss.maven.plugins</groupId>
+                <artifactId>maven-jdocbook-style-plugin</artifactId>
+                <version>2.0.0</version>
+                <extensions>true</extensions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-enforcer-plugin</artifactId>
+            </plugin>
+            <plugin>
+ <!-- Entry needed to create, install and deploy sources jars -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-release-plugin</artifactId>
+            </plugin>
+        </plugins>
+
+    </build>
+
+</project>
=======================================
--- /dev/null
+++ /src/main/resources/META-INF/maven/archetype-metadata.xml Tue May 1 02:30:43 2012
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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="my-sipapp" + 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" encoding="UTF-8">
+      <directory>dar</directory>
+      <includes>
+        <include>mobicents-dar.properties</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" packaged="true" encoding="UTF-8">
+      <directory>src/main/java</directory>
+      <includes>
+        <include>**/*.java</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+      <directory>src/main/sipapp</directory>
+      <includes>
+        <include>**/*.jsp</include>
+        <include>**/*.xml</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</archetype-descriptor>
=======================================
--- /dev/null
+++ /src/main/resources/archetype-resources/dar/mobicents-dar.properties Tue May 1 02:30:43 2012
@@ -0,0 +1,1 @@
+INVITE: ("com.mycompany.app.HelloWorldSipApplication", "DAR:From", "TERMINATING", "", "NO_ROUTE", "0")
=======================================
--- /dev/null
+++ /src/main/resources/archetype-resources/pom.xml     Tue May  1 02:30:43 2012
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <packaging>war</packaging>
+  <version>${version}</version>
+  <name>my-sipapp Maven SipApp</name>
+  <url>https://code.google.com/p/sipservlets/</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <!-- logging dependency -->
+               <dependency>
+                       <groupId>log4j</groupId>
+                       <artifactId>log4j</artifactId>
+                       <version>1.2.14</version>
+                       <scope>provided</scope>
+               </dependency>
+               <dependency>
+                       <groupId>commons-logging</groupId>
+                       <artifactId>commons-logging-api</artifactId>
+                       <version>1.0.4</version>
+                       <scope>provided</scope>
+               </dependency>
+
+               <!-- web j2ee dependencies -->
+               <dependency>
+                       <groupId>javax.servlet</groupId>
+                       <artifactId>servlet-api</artifactId>
+                       <version>2.5</version>
+                       <scope>provided</scope>
+               </dependency>
+               <!-- sip dependencies -->
+               <dependency>
+                       <groupId>org.mobicents.servlet.sip</groupId>
+                       <artifactId>sip-servlets-spec</artifactId>
+                       <version>1.7.0.FINAL</version>
+                       <scope>provided</scope>
+               </dependency>
+
+  </dependencies>
+       <build>
+               <finalName>my-sipapp</finalName>
+               <plugins>
+                       <plugin>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                               <version>2.4</version>
+                               <configuration>
+                                       <source>1.6</source>
+                                       <target>1.6</target>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <artifactId>maven-war-plugin</artifactId>
+                               <version>2.2</version>
+                               <configuration>
+                                       
<warSourceDirectory>${basedir}/src/main/sipapp</warSourceDirectory>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+       <!-- repositories -->
+       <repositories>
+               <repository>
+                         <id>mobicents-public-repository-group</id>
+                         <name>Mobicens Public Maven Repository Group</name>
+                         
<url>https://oss.sonatype.org/content/groups/public</url>
+                         <layout>default</layout>
+                         <releases>
+                           <updatePolicy>never</updatePolicy>
+                         </releases>
+                         <snapshots>
+                           <updatePolicy>never</updatePolicy>
+                         </snapshots>
+               </repository>
+               <repository>
+                       <id>jboss-public-repository-group</id>
+                       <name>JBoss Public Maven Repository Group</name>
+                       
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
+                       <layout>default</layout>
+                       <releases>
+                               <updatePolicy>never</updatePolicy>
+                       </releases>
+                       <snapshots>
+                               <updatePolicy>never</updatePolicy>
+                       </snapshots>
+               </repository>
+       </repositories>
+</project>
=======================================
--- /dev/null
+++ /src/main/resources/archetype-resources/src/main/java/HelloSipWorld.java Tue May 1 02:30:43 2012
@@ -0,0 +1,70 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package ${package};
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.sip.SipServlet;
+import javax.servlet.sip.SipServletRequest;
+import javax.servlet.sip.SipServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This example shows a typical UAS and reply 200 OK to any INVITE or BYE it receives
+ *
+ * @author Jean Deruelle
+ *
+ */
+public class HelloSipWorld extends SipServlet {
+
+       private static Log logger = LogFactory.getLog(HelloSipWorld.class);
+
+       @Override
+       public void init(ServletConfig servletConfig) throws ServletException {
+               logger.info("the HelloSipWorld servlet has been started");
+               super.init(servletConfig);
+       }
+
+       @Override
+ protected void doInvite(SipServletRequest request) throws ServletException,
+                       IOException {
+
+               logger.info("Got request:${symbol_escape}n"
+                               + request.toString());
+               String fromUri = request.getFrom().getURI().toString();
+               logger.info(fromUri);
+
+ SipServletResponse sipServletResponse = request.createResponse(SipServletResponse.SC_OK);
+               sipServletResponse.send();
+       }
+
+       @Override
+       protected void doBye(SipServletRequest request) throws ServletException,
+                       IOException {
+ SipServletResponse sipServletResponse = request.createResponse(SipServletResponse.SC_OK);
+               sipServletResponse.send();
+       }
+}
=======================================
--- /dev/null
+++ /src/main/resources/archetype-resources/src/main/sipapp/WEB-INF/sip.xml Tue May 1 02:30:43 2012
@@ -0,0 +1,26 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+
+<sip-app xmlns="http://www.jcp.org/xml/ns/sipservlet"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; + xsi:schemaLocation="http://www.jcp.org/xml/ns/sipservlet http://www.jcp.org/xml/ns/sipservlet/sip-app_1_1.xsd"; + xmlns:javaee="http://java.sun.com/xml/ns/javaee"; xmlns:xs="http://www.w3.org/2001/XMLSchema";
+        version="1.1">
+       <!-- Archetype Created SIP Application -->
+       <app-name>${package}.HelloSipWorldApplication</app-name>
+
+       <main-servlet>
+               HelloSipWorldServlet
+       </main-servlet>
+
+       <servlet>
+               <servlet-name>HelloSipWorldServlet</servlet-name>
+               <display-name>HelloSipWorldServlet</display-name>
+               <description>Hello SIP World Servlet</description>
+               <servlet-class>
+                       ${package}.HelloSipWorld
+               </servlet-class>
+               <load-on-startup>1</load-on-startup>
+       </servlet>
+</sip-app>
=======================================
--- /dev/null
+++ /src/main/resources/archetype-resources/src/main/sipapp/WEB-INF/web.xml Tue May 1 02:30:43 2012
@@ -0,0 +1,10 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd"; >
+
+<web-app>
+  <display-name>Archetype Created Web Application</display-name>
+</web-app>
=======================================
--- /dev/null
+++ /src/main/resources/archetype-resources/src/main/sipapp/index.jsp Tue May 1 02:30:43 2012
@@ -0,0 +1,8 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<html>
+<body>
+<h2>Hello SIP World!</h2>
+</body>
+</html>
=======================================
--- /dev/null
+++ /src/test/resources/projects/basic/archetype.properties Tue May 1 02:30:43 2012
@@ -0,0 +1,5 @@
+#Tue May 01 10:53:25 CEST 2012
+package=it.pkg
+version=0.1-SNAPSHOT
+groupId=archetype.it
+artifactId=basic

Reply via email to