Archive

Archive for February, 2016

TFS Build 2015 Gated Check-in Announced


In case you missed the news, the Visual Studio product team at Microsoft has announced the Gated check-in support for TFS Build 2015 (aka Build vNext) for TFVC repository. For more info visit

https://msdn.microsoft.com/en-us/Library/vs/alm/Build/news/2016

 

 

 

Advertisements
Categories: TFS2015, Uncategorized Tags: , ,

Maven test runs fail on some machines


Today I got this error when I ran a Maven build with the test goal on the new build server that I configured to compile the Java code.

[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ xxxxxx —
[INFO] Changes detected – recompiling the module!
[INFO] Compiling 67 source files to C:\Sc\ xxxxxx \target\classes
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 6.551 s
[INFO] Finished at: 2016-02-08T17:31:25-05:00
[INFO] Final Memory: 11M/61M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project xxxxxx Compilation failure -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I have the same .m2 folder as the other build severs. Maven and the JDK are configured properly as well. The only difference turned out to be that this server had a newer version of the Java JDK than the other servers. After inspecting the pom.xml file, I noticed that the maven-compiler-plugin had the javac.exe path hard coded

<plugin>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.1</version>

<configuration>

<fork>true</fork>

<executable>C:\Program Files\Java\jdk1.8.0_66\bin\javac.exe</executable>

</configuration>

</plugin>

I removed the hardcoded path and specified the Java version instead.

<plugin>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.1</version>

<configuration>

<fork>true</fork>

<source>1.8</source>

<target>1.8</target>

</configuration>

</plugin>

You can also follow the instructions at http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html to target multiple versions of the JDK

Categories: Java Tags: , ,