Trying to build on OpenBSD

59 views
Skip to first unread message

Bryan Everly

unread,
May 19, 2015, 7:38:57 PM5/19/15
to testng...@googlegroups.com
Hi,

I pulled the latest from Github and am trying to build using Maven (I'm working on the OpenJDK 1.8 port project for OpenBSD).  Anyhow I hit an error talking about a missing symbol ("class Version) that is referenced on lines 35 and 1110 in src/main/java/org/testng/TestNG.java and was wondering if there is a JAR file I need to have in my classpath or something?

Any help would be appreciated!

Thanks.

Cédric Beust ♔

unread,
May 19, 2015, 7:44:25 PM5/19/15
to testng...@googlegroups.com

Hi Bryan,

mvn clean package should be all you need. The error you are seeing indicates a compiler mismatch between several jar files, which should not happen from a clean build.

You can also build from Gradle if you want: ./gradlew clean build (the migration to Gradle is still a work in progress though).

If you’re still seeing the error, please post the full build output in a pastebin and link it here.

Thanks!


-- 
Cédric


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

吴亭

unread,
May 20, 2015, 3:16:47 AM5/20/15
to testng...@googlegroups.com
Hi Cedric,

I found in gradle, you update the config so that it will rename the version template to the Version.java, however, in maven, we dont't have any config about this part except a simple version filter.

Br,
Tim

吴亭

unread,
May 20, 2015, 3:29:58 AM5/20/15
to testng...@googlegroups.com
Hi Cedric,

Add this part into the pom.xml file will solve the problem

  <plugin>
    <groupId>com.coderplus.maven.plugins</groupId>
    <artifactId>copy-rename-maven-plugin</artifactId>
    <version>1.0.1</version>
    <executions>
      <execution>
        <id>rename-file</id>
        <phase>process-resources</phase>
        <goals>
          <goal>rename</goal>
        </goals>
        <configuration>
          <sourceFile>${version.build.directory}/org/testng/internal/VersionTemplateJava</sourceFile>
          <destinationFile>${version.build.directory}/org/testng/internal/Version.java</destinationFile>
        </configuration>
      </execution>
    </executions>
  </plugin>

If it is acceptable, I will create a patch for it.

Br,
Tim

Bryan Everly

unread,
May 20, 2015, 8:37:10 AM5/20/15
to testng...@googlegroups.com, ced...@beust.com
So just to be certain, I removed the entire directory and re-cloned from GitHub:

$ git clone git://github.com/cbeust/testng.git
$ cd testng
$ mvn package

When I did that, I got the same error.  I'm not really sure what to do.  Is it possibly that there is something that needs to be in my CLASSPATH or some environment variable I'm not setting (I literally just did the three things above per the website) and got the error.

Sorry for being a n00b...

吴亭

unread,
May 20, 2015, 8:42:34 AM5/20/15
to testng...@googlegroups.com
Hi,

If you don't mind do a small change in the pom.xml, then you can paste the plugin config I wrote in previous mail into your pom.xml, then build again, it will be okej.

Otherwise, as Cedric said, maybe you can try gradle.

Or even worse way, Version.java is a very simple one, if you only want to browser the code, you can just create a class Version.java for temp usage
package org.testng.internal;

public class Version {
  public static final String VERSION = "@version@";

  public static void displayBanner() {
    System.out.println("...\n... TestNG " + VERSION + " by Cédric Beust (ced...@beust.com)\n...\n");
  }
}

Bryan Everly

unread,
May 20, 2015, 9:29:38 AM5/20/15
to testng...@googlegroups.com
Tim,

Unfortunately, the additional section to my POM.XML led me to another error.  Sorry to be so darned needy but any help you can provide would be appreciated:

[INFO] Copying 14 resources
[INFO] 
[INFO] --- copy-rename-maven-plugin:1.0.1:rename (rename-file) @ testng ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.889 s
[INFO] Finished at: 2015-05-20T09:25:39-04:00
[INFO] Final Memory: 10M/156M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.coderplus.maven.plugins:copy-rename-maven-plugin:1.0.1:rename (rename-file) on project testng: sourceFile /home/bceverly/work/testng/target/generated-sources/version/org/testng/internal/VersionTemplateJava does not exist -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

Cédric Beust ♔

unread,
May 20, 2015, 9:40:24 AM5/20/15
to Bryan Everly, testng...@googlegroups.com
Maybe a bad jar file in your maven repo, delete ~/.m2/repo and try again.

-- 
Cédric

Cédric Beust ♔

unread,
May 20, 2015, 9:40:42 AM5/20/15
to testng...@googlegroups.com
Yes please, send a pull request.

Thanks!

-- 
Cédric

吴亭

unread,
May 20, 2015, 9:47:31 AM5/20/15
to testng...@googlegroups.com
Hi Bryan,

Sorry for a mistake, pls check the following config, you also need to change the source name from Version.java to this new telmplate file name.

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/VersionTemplateJava</include> 
        </includes>
        <filtering>true</filtering>
        <targetPath>${version.build.directory}</targetPath>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>


  <plugin>
    <groupId>com.coderplus.maven.plugins</groupId>
    <artifactId>copy-rename-maven-plugin</artifactId>
    <version>1.0.1</version>
    <executions>
      <execution>
        <id>rename-file</id>
        <phase>process-resources</phase>
        <goals>
          <goal>rename</goal>
        </goals>
        <configuration>
          <sourceFile>${version.build.directory}/org/testng/internal/VersionTemplateJava</sourceFile>
          <destinationFile>${version.build.directory}/org/testng/internal/Version.java</destinationFile>
        </configuration>
      </execution>
    </executions>
  </plugin>

吴亭

unread,
May 20, 2015, 9:53:40 AM5/20/15
to testng...@googlegroups.com

Bryan Everly

unread,
May 20, 2015, 10:38:20 AM5/20/15
to testng...@googlegroups.com
Cool.  Thank you SO MUCH for the help.

This got me over the problem.

Cédric Beust ♔

unread,
May 20, 2015, 9:19:10 PM5/20/15
to testng...@googlegroups.com
I merged Tim's pull request, Bryan can you try again from master?

Thanks!


-- 
Cédric

Bryan C. Everly

unread,
May 21, 2015, 9:09:34 AM5/21/15
to testng...@googlegroups.com
Working perfectly!

Thank you very much for the help.

Thanks,
Bryan
> You received this message because you are subscribed to a topic in the
> Google Groups "testng-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/testng-users/yD1dS9bIUfk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
Reply all
Reply to author
Forward
0 new messages