Page tree
Skip to end of metadata
Go to start of metadata

HowTo embed MoSKito Inspect into a maven built war

If you want to embed MoSKito web user interface to your webapp you can use following in your pom.

  <properties>
  	<moskito-version>2.5.1</moskito-version>
  </properties>
  <build>
    <plugins> 
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
             <configuration>
                <artifactItems><artifactItem>
                   <groupId>net.anotheria</groupId>
                   <artifactId>moskito-webui</artifactId>
                   <version>${moskito-version}</version>
                   <type>jar</type>
                   <overWrite>true</overWrite>
                   <outputDirectory>${project.build.directory}/tmp</outputDirectory>
                   <includes>moskito/**,**/*.jsp</includes>
                  </artifactItem></artifactItems>
             </configuration>
             <executions>
               <execution>
                 <phase>compile</phase>
                 <goals>
                   <goal>unpack</goal>
                 </goals>
               </execution>
             </executions>
       </plugin>
            
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1</version>
        <configuration>
           <webXml>etc/web.xml</webXml>
          <webResources>
            ....
            <resource>
              <directory>${project.build.directory}/tmp</directory>
            </resource>
          </webResources>
        </configuration>
      </plugin>
    </plugins>
</build>

You will need to declare following dependencies.

  <dependencies>
	<dependency>
		<groupId>net.anotheria</groupId>
		<artifactId>moskito-core</artifactId>
		<version>${moskito-version}</version>
	</dependency>
	<dependency>
		<groupId>net.anotheria</groupId>
		<artifactId>moskito-web</artifactId>
		<version>${moskito-version}</version>
	</dependency>
	<dependency>
		<groupId>net.anotheria</groupId>
		<artifactId>moskito-webui</artifactId>
		<version>${moskito-version}</version>
	</dependency>
  </dependencies>
  • No labels