How can I configure circle.yml correctly?


#1

My tests work fine on local machine, but when I try run it in circleCI it fails with this:

circleCi output

My circle.yml:

machine:
  java:
    version: oraclejdk8
test:
  override:
    - mvn integration-test
  post:
    - mkdir -p $CIRCLE_TEST_REPORTS/junit/
    - find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

pom.xml:

<?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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>hellogwt</groupId>
    <artifactId>hellogwt</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>

    <properties>
        <spring.version>4.2.4.RELEASE</spring.version>
        <hibernate.version>4.3.6.Final</hibernate.version>
        <gwt.version>2.5.0</gwt.version>
        <log4j.version>1.2.17</log4j.version>
        <jbcrybt.version>0.3m</jbcrybt.version>
        <postgres.version>9.4-1201-jdbc41</postgres.version>
        <junit.version>4.12</junit.version>
        <gwt.test.version>0.44</gwt.test.version>
        <mockito.version>1.10.19</mockito.version>
        <webAppDirectory>src/main/webapp/</webAppDirectory>
        <appache.commons.version>3.4</appache.commons.version>
    </properties>

    <dependencies>
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spring4gwt</groupId>
            <artifactId>spring4gwt</artifactId>
            <version>0.0.1</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/spring4gwt-0.0.1.jar</systemPath>
        </dependency>

        <!--Hibernate-->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <!--DataBase-->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgres.version}</version>
        </dependency>


        <!--GWT-->
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-servlet</artifactId>
            <version>${gwt.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>${gwt.version}</version>
            <scope>provided</scope>
        </dependency>

        <!--Log-->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
        </dependency>

        <!--Crypt-->
        <dependency>
            <groupId>org.mindrot</groupId>
            <artifactId>jbcrypt</artifactId>
            <version>${jbcrybt.version}</version>
        </dependency>

        <!--WelcomePhrase-->
        <dependency>
            <groupId>welcome</groupId>
            <artifactId>task</artifactId>
            <version>1.0-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/task-1.0-SNAPSHOT.jar</systemPath>
        </dependency>

        <!--Tests-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.googlecode.gwt-test-utils</groupId>
            <artifactId>gwt-test-utils</artifactId>
            <version>${gwt.test.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>hellogwt</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>2.5.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>**/WelcomeWebAppTest.java</includes>
                    <mode>htmlunit</mode>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <additionalClasspathElements>
                        <additionalClasspathElement>${project.build.sourceDirectory}</additionalClasspathElement>
                        <additionalClasspathElement>${project.build.testSourceDirectory}</additionalClasspathElement>
                    </additionalClasspathElements>
                    <useManifestOnlyJar>false</useManifestOnlyJar>
                    <forkMode>always</forkMode>
                    <systemProperties>
                        <property>
                            <name>gwt.args</name>
                            <value>-out \${webAppDirectory}</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
            <!-- Tomcat plugin -->
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <configuration>
                    <server>TomcatServer</server>
                    <url>http://localhost:8080/manager</url>
                    <username>tomcat</username>
                    <password>tomcat</password>
                    <path>/hellogwt</path>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

I think, that my classpath is wrong, or something else, but I don’t know how to configure it in circle.yml
I will be glad of any help.


#2