Hi All,

Hi have written a sample plugin for Sonar with only 2 rules.

I've generated the archetype. 

And edited the pom.xml.

The pom is attached for reference.

When I run mvn clean install, I get the error which says cannot find the
class TestPlugin.

Any help would be appreciated.

 

Regards,

Kabir

  

ATG Developer, Service Creation - eCommerce 

  

        
        

 

<?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>com.ustri.plugin</groupId>
  <artifactId>atgplugin</artifactId>
  <packaging>sonar-plugin</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Sonar ATG plugin</name>
  <description>Analyze ATG Jsps</description>

  <!-- optional -->
  <organization>
    <name>My company</name>
    <url>http://www.mycompany.com</url>
  </organization>
  
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.codehaus.sonar</groupId>
        <artifactId>sonar-plugin-api</artifactId>
        <version>2.5</version>
        <!-- dependencies of sonar-plugin-api (pmd) should not get older version of junit -->
      </dependency>
    </dependencies>
  </dependencyManagement>
  
  <dependencies>
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-plugin-api</artifactId>
      <version>2.5</version>
    </dependency>
    
    <!-- add your dependencies here -->
	<dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-channel</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>
	
	<dependency>
      <groupId>javax.el</groupId>
      <artifactId>el-api</artifactId>
      <version>1.0</version>
      <scope>compile</scope>
    </dependency>
	
	<dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam</artifactId>
      <version>2.2.0.GA</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>dom4j</groupId>
          <artifactId>dom4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xstream</groupId>
          <artifactId>xstream</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xpp3</groupId>
          <artifactId>xpp3_min</artifactId>
        </exclusion>
        <exclusion>
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    
    <!-- unit tests -->
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-testing-harness</artifactId>
      <version>2.5</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.sonar</groupId>
        <artifactId>sonar-packaging-maven-plugin</artifactId>
        <version>1.0</version>
        <extensions>true</extensions>
        <configuration>
		  <pluginClass>com.ustri.plugin.TestPlugin</pluginClass>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
    </plugins>
  </build>
  
  <repositories>
    <repository>
      <id>repository.jboss.org</id>
      <name>JBoss Repository</name>
      <url>http://repository.jboss.org/maven2</url>
    </repository>
    <repository>
      <id>codehaus.org</id>
      <name>Codehaus Repository</name>
      <url>http://repository.codehaus.org</url>
    </repository>
  </repositories>
</project>

Reply via email to