GZIPInInterceptor,
simple as creating instance and adding as in-Interceptor to service endpoint
GZIPOutInterceptor,
simple as creating instance and adding as out-Interceptor to service endpoint, make sure to define threshold value when creating insance
GZIPInInterceptor gzipInInterceptor = new GZIPInInterceptor();
GZIPOutInterceptor gzipOutInterceptor = new GZIPOutInterceptor(0);
server.getEndpoint().getInInterceptors().add(gzipInInterceptor);
server.getEndpoint().getOutInterceptors().add(gzipOutInterceptor);
Wednesday, November 5, 2014
Monday, November 3, 2014
How to configure custom check style plugin
Mainly there are 3 files to configure
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.10</version>
<dependencies>
<dependency>
<groupId>com.intel.ase.osg</groupId>
<artifactId>com.intel.ase.osg.governance</artifactId>
<version>${ase.osg.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<configLocation>../com.intel.ase.osg.governance/src/main/resources/governance/osg_checks.xml</configLocation>
<suppressionsLocation>../com.intel.ase.osg.governance/src/main/resources/governance/checkstyle-suppressions.xml</suppressionsLocation>
<!--<headerLocation>governance/header.txt</headerLocation>-->
<propertyExpansion>config_loc=../com.intel.ase.osg.governance/src/main/resources/governance</propertyExpansion>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
Sample java code usage after configuration,
public class IdentityServiceException extends Exception {
// CHECKSTYLE:OFF
private IdentityError error;
// CHECKSTYLE:ON
..................................
2. Using suppress expression
include below line to checkstyle-suppressions.xml
- checks.xml
- checkstyle-suppressions
- pom.xml
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>2.10</version>
<dependencies>
<dependency>
<groupId>com.intel.ase.osg</groupId>
<artifactId>com.intel.ase.osg.governance</artifactId>
<version>${ase.osg.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<configLocation>../com.intel.ase.osg.governance/src/main/resources/governance/osg_checks.xml</configLocation>
<suppressionsLocation>../com.intel.ase.osg.governance/src/main/resources/governance/checkstyle-suppressions.xml</suppressionsLocation>
<!--<headerLocation>governance/header.txt</headerLocation>-->
<propertyExpansion>config_loc=../com.intel.ase.osg.governance/src/main/resources/governance</propertyExpansion>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
- How to suppress check-style validation for particular class
- Using SuppressionCommentFilter
Sample java code usage after configuration,
public class IdentityServiceException extends Exception {
// CHECKSTYLE:OFF
private IdentityError error;
// CHECKSTYLE:ON
..................................
2. Using suppress expression
include below line to checkstyle-suppressions.xml
<suppress files="TheClassToIgnore\.java" checks="[a-zA-Z0-9]*"/>
Wednesday, September 10, 2014
How to generate javaDoc through mvn plugin
How to generate javaDoc through mvn plugin
- Add below snip to generate source jar
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>bundle-sources</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
- Add below snip to parent pom to unzip generated source
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-artifact-sources</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.intel.ase.osg</groupId>
<artifactId>com.intel.ase.osg.core</artifactId>
<version>${ase.osg.version}</version>
<classifier>sources</classifier>
<overWrite>true</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/unpack_sources</outputDirectory>
</configuration>
</execution>
<!-- add more unpack-executions here -->
</executions>
</plugin>
- Add below snip to generate javaDoc from unzip source files
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<configuration>
<sourcepath>${project.build.directory}/unpack_sources</sourcepath>
</configuration>
<executions>
<execution>
<goals>
<goal>javadoc</goal>
</goals>
<phase>process-resources</phase>
</execution>
</executions>
</plugin>
When you call
mvn clean install at this point you will end up with a site folder inside your target folder. In this site folder you'll find your apidocs.
Subscribe to:
Posts (Atom)