Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not build MTA project via Windows CMD but via Git Bash it works #654

Closed
peterkovac opened this issue Jan 8, 2020 · 3 comments
Closed
Assignees

Comments

@peterkovac
Copy link

peterkovac commented Jan 8, 2020

Environment info:

  • MBT Version: 1.0.7 (installed via npm)
  • GNU Make 4.2.1 Built for Windows32
  • OS Version: Microsoft Windows 10 Enterprise (Version 10.0.17763 Build 17763)

Steps to Reproduce:

  1. When I run mbt build via Windows CMD the build crashes with following error message:
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.865 s
[INFO] Finished at: 2020-01-08T17:09:29+01:00
[INFO] ------------------------------------------------------------------------
[2020-01-08 17:09:29]  INFO the build results of the "bank-mock-service" module will be packed and saved in the "C:\Users\XXX\IdeaProjects\bankmockservice\.bankmockservice_mta_build_tmp\bank-mock-service" folder
INFO finished building the "bank-mock-service" module
INFO generating the metadata...
INFO generating the MTA archive...
ERROR could not generate the MTA archive when archiving: CreateFile C:\Users\XXX\IdeaProjects\bankmockservice --mtar=.\.bankmockservice_mta_build_tmp: The system cannot find the path specified. 
make: *** [Makefile_20200108170857.mta:50: mtar] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20200108170857.mta p=cf mtar=. strict=true mode=" command: exit status 2
  1. When I run the same command from Git Bash command line, the build is succesful.\
  2. When my collegue runs the same command from Windows CMD on his computer, everything works fine.
@allaVolkov
Copy link
Contributor

allaVolkov commented Jan 9, 2020

Hello Peter,

Can you please provide link to your project or at least mta.yaml?
Can you try to run also the following:

  1. mbt init
  2. make -f Makefile.mta p=cf

If these commands or one of them fails please provide the log.

Thank you,
Alla

@allaVolkov allaVolkov self-assigned this Jan 9, 2020
@peterkovac
Copy link
Author

Well, I've tried commands you texted me. The error message I've got is as follows:

/cygdrive/c/Users/XXX/AppData/Roaming/npm/mbt: line 2: sed: command not found
/cygdrive/c/Users/XXX/AppData/Roaming/npm/mbt: line 2: dirname: command not found
/cygdrive/c/Users/XXX/AppData/Roaming/npm/mbt: line 4: uname: command not found
module.js:550
    throw err;
    ^

Error: Cannot find module 'C:\node_modules\mbt\bin\mbt'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
make: *** [Makefile.mta:26: pre_validate] Error 1

In addition, my mta.yaml looks like this (some parts of text substituted with XXX):

_schema-version: "2.0.0"
ID: XXX
version: 1.0.0

modules:
  - name: XXX
    type: java
    path: .
    build-parameters:
      builder: custom
      build-result: target/*.jar
      commands:
        - mvn clean
        - mvn verify
    properties:
      SPRING_PROFILES_ACTIVE: cloud
    parameters:
      timeout: 180
      memory: 1024M
      host: ${default-host}
      domain: XXX 
      health-check-type: process
      health-check-timeout: 180
    provides:
      - name: XXX
        properties:
          url: '${default-url}'
    requires:
      - name: uaa_XXX
      - name: XXX-db-hdi-container

resources:
  - name: uaa_XXX
    type: org.cloudfoundry.existing-service

  - name: XXX-db-hdi-container
    type: org.cloudfoundry.existing-service

@allaVolkov
Copy link
Contributor

Fix provided in version 1.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants