Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9140173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:28:54+00:00 2026-06-17T09:28:54+00:00

I have a project in Hudson that is build with maven. It compiles C++

  • 0

I have a project in Hudson that is build with maven. It compiles C++ source code to create a an executable that is used in other parts of the project. It uses the Visual Studio tools, specially one that is causing trouble. When it tries to load the midl program it can’t find it. If I log into the server were my Hudson lives and try to run mvn clean install in that particular project I get:

D:\Hudson\jobs\{project-name}>mvn clean install
.
.
.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.876s
[INFO] Finished at: Mon Jan 14 21:56:18 PST 2013
[INFO] Final Memory: 8M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (build-tlb) on project interop: Command execution failed.
Cannot run program "midl" (in directory "D:\Hudson\jobs\{project-name}"): CreateProcess error=2, The system cannot find the file specified ->     [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/MojoExecutionException

A way to around this is to load the Visual Studio tools:

D:\Hudson\jobs\{project-name}>%VS100COMNTOOLS%\vsvars32.bat
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

After doing that I get a clean build:

D:\Hudson\jobs\{project-name}>mvn clean install
.
.
.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.331s
[INFO] Finished at: Mon Jan 14 21:59:06 PST 2013
[INFO] Final Memory: 13M/222M
[INFO] ------------------------------------------------------------------------

But this does not work when Hudson kicks of an automatic build. I tried to load that bat file (vsvars32.bat) performing:

pushd %VS100COMNTOOLS%
vsvars32.bat
popd

before I start the maven process, I know this is working because I see this in the console output:

C:\Apps\MicrosoftVisualStudio-10.0\Common7\Tools>vsvars32.bat
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

but whenever it gets to the point in which midl is actually used I get this output after the BUILD FAILURE:

[INFO] o.h.m.e.h.MavenExecutionResultHandler - Build failed with exception(s)
[INFO] o.h.m.e.h.MavenExecutionResultHandler -     [1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (build-tlb) on project interop: Command execution failed.
[DEBUG] Closing connection to remote

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (build-tlb) on project interop: Command execution failed. Cannot run program "midl" (in directory "D:\Hudson\jobs\{project-name}"): CreateProcess error=2, The system cannot find the file specified ->     [Help 1]

I also set the environmental variable pair {VS100COMNTOOLS,C:\Apps\MicrosoftVisualStudio-10.0\Common7\Tools} in the Hudson configuration panel. I do not know what else to do, any help will be apreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:28:55+00:00Added an answer on June 17, 2026 at 9:28 am

    I finally figured this out. The way that Hudson calls new task is to call a new cmd window so the %VS100COMNTOOLS%\vsvars32.bat tools are set in a different instance. Looking at the mvn.bat in %MAVEN_HOME%\bin it lets you call a bat file before:
    if exist “%HOME%\mavenrc_pre.bat” call “%HOME%\mavenrc_pre.bat”
    I called the %VS100COMNTOOLS%\vsvars32.bat there so every time we run maven the visual tools are also loaded. Nevertheless, it seems that Hudson does not start a maven task by calling that particular bat file, it somehow creates its own instance of maven, ignoring that mavenrc_pre.bat. A way to get around this is to create the task not as a Maven task, but as a batch task and simply call:
    mvn clean install
    This solved my problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Maven-managed project that uses Mockito mocking in its unit tests. I
I have integrated in Hudson a maven 3 project calling following sequence: clean tomcat:redeploy
I have a Hudson CI server which is building a making a maven build.
I want to use hudson to build a maven-java project. Some of my integration
I have a Maven project that is a child project. It has many sibling
We currently have a big Maven 2 project that is rather a collection of
We are using Hudson with git. We have a build/test server which compiles our
I have an Android test project that I'd like to link into Hudson, but
I have such a situation : one hudson job for one project that is
I use maven/hudson to build my project. One of the goals run by hudson

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.