构建项目不包括所有类

时间:2015-05-20 09:32:46

标签: java maven build pom.xml

我用以下方式构建我的项目:

  

mvn clean package

当我尝试运行它时,我收到以下错误:

  

[TestNG] [ERROR]在类路径中找不到类:eu.copla.test.sanity.communications.ctm.ESH2320_CTM_Limitation

我解压缩了.jar文件并且那些类不存在错误的原因,所以我必须包含它们,据我所知是pom.xml问题我试图将它们包含在pom中.xml以这种方式:

 <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-clean-plugin</artifactId>
    <executions>
         <execution>
              <id>default-clean</id>
              <configuration>
               <includes>
                 <include>eu/copla/test/sanity/communications/**/*.*</include>
                </includes>
              </configuration>
         </execution>
     </executions>
 </plugin>

但那没用。有任何想法吗?感谢

完整的pom.xml:

<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>eu.ohim.copla</groupId>
    <artifactId>copla-selenium</artifactId>
    <name>copla-selenium</name>
    <version>1.0.0</version>
    <parent>
        <groupId>eu.ohim</groupId>
        <artifactId>esearch-parent</artifactId>
        <version>1.9.0-RC1.2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

  <packaging>jar</packaging>

  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jboss.version>7.1.1.Final</jboss.version>
  </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.16</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin> 

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <nonFilteredFileExtensions>
                        <nonFilteredFileExtension>zip</nonFilteredFileExtension>
                        <nonFilteredFileExtension>mp3</nonFilteredFileExtension>
                        <nonFilteredFileExtension>jpg</nonFilteredFileExtension>
                        <nonFilteredFileExtension>png</nonFilteredFileExtension>
                    </nonFilteredFileExtensions>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/shade.xml</descriptor>
                        <descriptor>src/main/assembly/delivery-test.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> 
                        <phase>package</phase> 
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>               
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-clean</id>
                        <configuration>
                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
                            <filesets>
                                <fileset>
                                    <directory>target</directory>
                                    <excludes>
                                        <exclude>failsafe-reports/**/*.*</exclude>
                                    </excludes>
                                    <followSymlinks>false</followSymlinks>
                                </fileset>
                            </filesets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>           

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-clean</id>
                            <configuration>
                                <includes>
                                    <include>eu/ohim/copla/test/sanity/communications/**/*.*</include>
                                </includes>
                            </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

  <dependencies>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.41.0</version>
    </dependency>   

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
    </dependency>   

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>4.1.4.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
    </dependency>   

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.4</version> 
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
    </dependency>

    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.9.0</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>   

    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-integration</artifactId>
        <version>1.3</version>
    </dependency>   

    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.8.5</version>
        <scope>test</scope> 
        <exclusions>
            <exclusion>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
            </exclusion>
        </exclusions>   
    </dependency>

    <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils-core</artifactId>
        <version>1.8.3</version>
    </dependency>

    <dependency>
        <groupId>commons-dbutils</groupId>
        <artifactId>commons-dbutils</artifactId>
        <version>1.5</version>
    </dependency>

    <dependency>
      <groupId>com.nitorcreations</groupId>
      <artifactId>matchers</artifactId>
      <version>1.3</version>
    </dependency>

    <dependency>
        <groupId>commons-jxpath</groupId>
        <artifactId>commons-jxpath</artifactId>
        <version>1.3</version>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>2.2.7</version>
    </dependency>

    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.18</version>
    </dependency>

    <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
    </dependency>

    <dependency>
        <groupId>com.ibm.informix</groupId>
        <artifactId>ifxjdbc_10</artifactId>
        <version>10</version>
    </dependency>

    <dependency>
        <artifactId>solr-solrj</artifactId>
        <groupId>org.apache.solr</groupId>
        <version>1.4.1</version>
    </dependency>

    <dependency>        
         <groupId>org.uncommons</groupId>         
         <artifactId>reportng</artifactId>         
         <version>1.1.2</version>         
         <scope>test</scope>         
    </dependency>

    <dependency>     
        <groupId>com.google.inject</groupId>     
        <artifactId>guice</artifactId>     
        <version>3.0</version>     
        <scope>test</scope> 
    </dependency> 

  </dependencies>

    <profiles>
        <profile>
            <!-- needed for Bamboo -->
            <id>integration-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${surefirePluginVersion}</version>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>src/test/resources/bin/testng-qc-sanity-regression.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>  
                    </plugin> 

                    <plugin>             
                        <groupId>org.apache.maven.plugins</groupId>             
                        <artifactId>maven-surefire-plugin</artifactId>             
                        <version>2.5</version>             
                        <configuration>                 
                        <properties>                     
                            <property>                         
                                <name>listener</name>                         
                                <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>                     
                            </property>                 
                        </properties>                 
                        </configuration>         
                    </plugin>                   
                </plugins>
            </build>
        </profile>

        <profile>
            <!-- needed for Bamboo -->      
            <id>deploy-tomcat</id>
        </profile>  

    </profiles>

</project>

0 个答案:

没有答案