Child pages
  • Cipango Maven Plugin

This documentation relates to last stable version of Cipango.
visit the last unstable documentation home.

Skip to end of metadata
Go to start of metadata

Cipango Maven Plugin Configuration Guide

This plugin is based on Jetty Maven Plugin, most of the options available on jetty plugin are also available.

To run a sip application from a maven project,

  1. add it in your POM file:
      <build>
        ...
        <plugins>  
          <plugin>
            <groupId>org.cipango</groupId>
            <artifactId>cipango-maven-plugin</artifactId>
         </plugin>
        </plugins>
      </build>
    
      <repositories>
        <repository>
          <id>cipango.org</id>
          <name>Cipango Plugin Repository</name>
          <url>http://repository.cipango.org</url>
        </repository>
      </repositories>
    
      <pluginRepositories>
        <pluginRepository>
          <id>cipango.org</id>
          <name>Cipango Plugin Repository</name>
          <url>http://repository.cipango.org</url>
        </pluginRepository>
      </pluginRepositories>
    

Plugin has been renamed from maven-cipango-plugin (branch 1.x) to cipango-maven-plugin to be compliant with Maven standarts

  1. start the plugin:
    mvn cipango:run

Running this plugin on microsoft Windows may have a exception like java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/... when lauching plugin. Using maven 3 fix this issue. Please refer to issue JETTY-1063

How to configure the plugin

Container Configuration

  • sipConnectors optional. List of sip connectors to use. If none are configured then UDP and TCP connectors at port 5060 and on first public address. You can override this default port number and host by using the system properties sip.port and sip.host on the command line, eg: mvn -Dsip.port=9999 -Dsip.host=localhost cipango:run.
  • messageLog optional. The sip messages logger to use. If none are configured, then a file message logger is created in the directory <code>target/logs</code>.
  • connectors, jettyConfig, scanIntervalSeconds, systemProperties, userRealms As described in the Maven Jetty Plugin.
Webapp Configuration
  • sipDefaultXml optional. A sipdefault.xml file to use instead of the default for the sipapp.
  • overrideSipXml optional. A sip.xml file to be applied AFTER the webapp's sip.xml file. Useful for applying different build profiles, eg test, production etc.
  • annotationsEnabled optional. Allow to disable annotations parsing. true by default.
  • contextPath, tmpDir, overrideWebXml, webDefaultXml As described in the Maven Jetty Plugin.
<project>
  ...
  <plugins>
    ...
      <plugin>
        <groupId>org.cipango</groupId>
        <artifactId>cipango-maven-plugin</artifactId>
        <configuration>
          <scanIntervalSeconds>5</scanIntervalSeconds>
          <!-- Http configuration -->
          <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
              <port>9090</port>
              <maxIdleTime>60000</maxIdleTime>
            </connector>
          </connectors>
          <!-- SIP configuration -->
          <sipConnectors>
            <sipConnector implementation="org.cipango.server.bio.UdpConnector">
              <port>5060</port>
            </sipConnector>
          </sipConnectors>
          <messageLog implementation="org.cipango.server.log.FileMessageLog">
            <filename>target/logs/yyyy_mm_dd.message.log</filename>
            <retainDays>90</retainDays>
            <append>true</append>
          </messageLog>
        </configuration>
      </plugin>
  </plugins>
</project>

Configure with diameter support

To enable diameter support with maven plugin, the following configuration should be used.

pom.xml
<project>
  ...
  <plugins>
    ...
      <plugin>
        <groupId>org.cipango</groupId>
        <artifactId>cipango-maven-plugin</artifactId>
        <configuration>
          <jettyConfig>etc/diameter-mavenPlugin.xml</jettyConfig>
          <webAppConfig>
            <configurationClasses>
              <configurationClasse>org.mortbay.jetty.plugin.MavenWebInfConfiguration</configurationClasse>
              <configurationClasse>org.eclipse.jetty.webapp.WebXmlConfiguration</configurationClasse>
              <configurationClasse>org.eclipse.jetty.webapp.MetaInfConfiguration</configurationClasse>
              <configurationClasse>org.eclipse.jetty.webapp.FragmentConfiguration</configurationClasse>
              <configurationClasse>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</configurationClasse>
              <configurationClasse>org.eclipse.jetty.webapp.TagLibConfiguration</configurationClasse>
              <configurationClasse>org.cipango.sipapp.SipXmlConfiguration</configurationClasse>
              <configurationClasse>org.cipango.diameter.app.DiameterConfiguration</configurationClasse>
            </configurationClasses>
            <contextPath>/</contextPath>
          </webAppConfig>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.cipango</groupId>
            <artifactId>cipango-diameter</artifactId>
            <version>2.0-SNAPSHOT</version>
          </dependency>
        </dependencies>
      </plugin>
  </plugins>
</project>
etc/diameter-mavenPlugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<Configure class="org.cipango.server.Server" id="Server">

  <Call name="addLifeCycle">
    <Arg>
      <New id="node" class="org.cipango.diameter.Node">
        <Set name="server"><Ref id="Server"/></Set>
        <Call name="addConnector">
          <Arg>
            <New class="org.cipango.diameter.bio.DiameterSocketConnector">
              <Set name="port"><SystemProperty default="3868" name="diameter.port"/></Set>
              <Set name="node"><Ref id="node"/></Set>
            </New>
          </Arg>
        </Call>
        <Set name="router">
          <New class="org.cipango.diameter.Router">
            <Set name="node"><Ref id="node"/></Set>
            <Call name="addPeer">
              <Arg>
                <New class="org.cipango.diameter.Peer">
                  <Arg>hss.cipango.org</Arg>
                </New>
              </Arg>
            </Call>
          </New>
        </Set>
      </New>
    </Arg>
  </Call>

  <Call name="setAttribute">
    <Arg>org.cipango.diameter.Node</Arg>
    <Arg><Ref id="node"/></Arg>
  </Call>
</Configure>
  • No labels