Using Jnario with tycho on a CI server

176 views
Skip to first unread message

Martin Schreiber

unread,
Nov 4, 2013, 4:50:38 AM11/4/13
to jna...@googlegroups.com
Hi,

I am wondering if somebody can provide me an example pom.xml which uses tycho to build an Eclipse-Test-Plugin an generates/compiles the Jnario sources.
Background:
We are building an Eclipse RCP Application using Tycho and started with Jnario tests. Within Eclipse everything is working fine, the test classes are generated with XText and the Jnario tests are executed fine but on our CI server (Jenkins) the Jnario test classes are not generated.

Thanks,
martin


Jeremy

unread,
Nov 5, 2013, 9:30:26 AM11/5/13
to jna...@googlegroups.com
What fault do you get on the build server Martin? We use a Bamboo server at my org which compiles the tests, pretty much as per the maven example in Seb's github repo - https://github.com/sebastianbenz/Jnario/blob/master/examples/org.jnario.maven.example/pom.xml - although we're still using jnario 0.5.1.

We make a maven call to lifecycles"clean" followed by "test-compile" to build the test classes.

Martin Schreiber

unread,
Nov 6, 2013, 8:04:53 AM11/6/13
to jna...@googlegroups.com

If I am using that example pom.xml file an run the maven build, the jnario and xtext are searching the stuff in the default maven location ( "src/main/java"; "src/test/java", "src\test\generated-sources\xtend") but because we do have an Eclipse Test-Plugin the source directory is "src" and so we get the warnings that xtend and jnario cannot find anything to compile.

The warnings:

[INFO] --- xtend-maven-plugin:2.5.0-SNAPSHOT:compile (default) @ com.foo.bar.testplugin ---
[INFO] No sources to compile in 'D:\ws_cpp395_neu\com.foo.bar.testplugin\src'
[INFO]
[INFO] --- xtend-maven-plugin:2.5.0-SNAPSHOT:xtend-install-debug-info (default) @ com.foo.bar.testplugin ---
[WARNING] Directory D:\ws_cpp395_neu\com.foo.bar.testplugin\src\main\java is empty. Can't process.
[INFO] Installing Xtend files into 0 class files as secondary (via SMAP) debug sources in: D:\ws_cpp395_neu\com.foo.bar.testplugin\target\classes
[INFO]
[INFO] --- jnario-maven-plugin:1.0.0-SNAPSHOT:testCompile (default) @ com.foo.bar.testplugin ---
[INFO] skip compiling sources because the configured directory '[D:\ws_cpp395_neu\com.foo.bar.testplugin\src\test\java]' does not exists.
[INFO] skip compiling sources because the configured directory '[D:\ws_cpp395_neu\com.foo.bar.testplugin\src\test\java, D:\ws_cpp395_neu\com.foo.bar.testplugin\src\test\generated-sources\xtend]' does not exists.
[INFO] skip compiling sources because the configured directory '[D:\ws_cpp395_neu\com.foo.bar.testplugin\src\test\java, D:\ws_cpp395_neu\com.foo.bar.testplugin\src\test\generated-sources\xtend]' does not exists.
[INFO] skip compiling sources because the configured directory '[D:\ws_cpp395_neu\com.foo.bar.testplugin\src\test\java, D:\ws_cpp395_neu\com.foo.bar.testplugin\src\test\generated-sources\xtend]' does not exists.

When specifing the source directory in the pom file using the property "sourceDirectory" and "testSourceDirectory"
<build>
    <outputDirectory>${basedir}/xtend-gen</outputDirectory>
    <testSourceDirectory>${project.basedir}/src/</testSourceDirectory>
    <sourceDirectory>${project.basedir}/src/</sourceDirectory>
</build>

xtend does look into the right directory, but it's saying: "No source to compile in D:\ws_cpp395_neu\com.foo.bar.testplugin\src, the jnario plugin does still try to search the stuff in D:\ws_cpp395_neu\com.foo.bar.testplugin\src\test\generated-sources\xtend.

The Project Structure is:

com.foo.bar/
      pom.xml
      src/com.foo.bar/TestFeature.feature
      build.properties
      plugin.xml

Sebastian Benz

unread,
Nov 6, 2013, 11:36:11 AM11/6/13
to jna...@googlegroups.com
Hi,

you could try to add the additional source folder using the build-helper-maven-plugin.

Cheers,

Sebastian

   <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.7</version> <executions> <execution> <id>add-source</id> <phase>generate-sources</phase> <goals> <goal>add-source</goal> <goal>add-test-source</goal> </goals> <configuration> <sources> <source>${basedir}/xtend-gen</source> </sources> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clean-plugin</artifactId> <version>2.4.1</version> <configuration> <filesets> <fileset> <directory>${basedir}/xtend-gen</directory> <includes> <include>**</include> </includes> <excludes> <exclude>.gitignore</exclude> </excludes> </fileset> </filesets> </configuration> </plugin>
<plugin>
<groupId>org.jnario</groupId>
<artifactId>jnario-maven-plugin</artifactId>
<version>${jnario.version}</version>
<executions>
<execution>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/xtend-gen</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>





--
You received this message because you are subscribed to the Google Groups "Jnario" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jnario+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Martin Schreiber

unread,
Mar 4, 2014, 5:00:30 AM3/4/14
to jna...@googlegroups.com
Hi,

thanks! Finally I was able to let Jenkins create and and execute the Specs/Features/Suites as part of an Eclipse Test Plugin Project with the following Configuration:

    <build>
        <plugins>
            <!-- Adds the src directory (Eclipse style), so that jnario/Xtend can find it  -->

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-test-source</id>
                        <phase>generate-sources</phase>
                        <goals>

                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${basedir}/src</source>

                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Let 'clean' clean the xtend-gen directory -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}/xtend-gen</directory>
                            <includes>
                                <include>**</include>
                            </includes>
                            <excludes>
                                <exclude>.gitignore</exclude>
                            </excludes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <!-- Let Jnario/Xtend generate the test classes in the generate-sources phase -->

            <plugin>
                <groupId>org.jnario</groupId>
                <artifactId>jnario-maven-plugin</artifactId>
                <version>0.7.1</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <testOutputDirectory>${basedir}/xtend-gen</testOutputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
Reply all
Reply to author
Forward
0 new messages