Archive

Posts Tagged ‘Java’

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

Advertisements
Categories: Java Tags: , ,

Offline Installation of TFS Eclipse Plugin


I was working with one client with a locked down dev environment (i.e. no internet access on dev machines). They use TFS as their ALM tool. Long story short, I wanted to install the TFS Eclipse Plugin. The following are the steps that I went through to install the plugin offline.

Download TFS Eclipse Plugin (version 14.02 is available at https://www.microsoft.com/en-us/download/details.aspx?id=47727)

  • Open Eclipse
  • Click on Help à Install New Software


  • Click the Add button then the Archive button
  • Select the zip file for the TFS Eclipse plugin
  • Click the Open button


  • Check The Team Explorer Everywhere plugin and click the next button. Eclipse will calculate the dependency. This may take few minutes


  • Click the next button on Install Details window


  • Accept the license agreement and click the Finish button
  • Click Yes to restart Eclipse


  • Click the Open Perspective button, Select Team Foundation Sever Exploring and click OK


Connect Eclipse to TFS Server

  • Click on Connect to Team Foundation Server then click the Servers button
  • Click the Add button to add a new TFS server
  • Type in the TFS url


  • Click OK and close the Add/Remove TFS window
  • Select your team project and click the Finish button


Categories: ALM, Uncategorized Tags: , , ,

TFS Build: Unable to load task handler PowerShell for task …


While I was trying run a TFS build for the first time on a Windows 2008 R2 SP1 machine, I got the following error

Unable to load task handler PowerShell for task Maven with version 1.0.13

To determine the Powershell version that is installed on your system:

Open Windows Powershell

Type $PSVersionTable.PSVersion

If you have a version that is lower than 3.0, you will need to update to a recent version of Powershell

In my case, I had PS 2.0 installed. I upgraded to PS 4.0 which I downloaded from

http://www.microsoft.com/en-us/download/details.aspx?id=40855

and that fixed my issue

PS: read the installation instructions to determine proper file name to download

 

Categories: ALM, TFS2015 Tags: , , , , ,