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

Issues building BTVA on Windows #635

Open
bcpmihail opened this issue Feb 27, 2025 · 1 comment
Open

Issues building BTVA on Windows #635

bcpmihail opened this issue Feb 27, 2025 · 1 comment
Labels
area/maven Relates to maven changes kind/bug Something isn't working os/windows triage/needed Needs to be discussed by project maintainers

Comments

@bcpmihail
Copy link
Contributor

Description

Building BTVA on Windows fails due to an error in maven license plugin not accepting backslashes in project base path (see screenshot)

Image

Steps to Reproduce

Follow the steps from the How to build section of the README.
The error occurs on executing the first maven command:

mvn clean install -f pom.xml -pl .

Preconditions: [What are the preconditions to reproduce the issue]

Expected behavior: [What you expect to happen]

Actual behavior: [What actually happens]

Reproduces how often: [What percentage of the time does it reproduce]

Component/s: [What are the Build Tools for VMware Aria components affected by the issue (e.g. "common/artifact-manager", "maven/plugins/vra-ng", "typescript/vrotest", etc)]

Affects Build/s: [Which are the Build Tools for VMware Aria releases / builds affected by the issue]

Environment

Client

  • Build Tools for VMware Aria Version: 4.2.0
  • Visual Studio Code Version: 1.97.2
  • OS Version: Windows 11 Pro 23H2, OS build 22631.4890
  • Maven Version: 3.9.9 (also occurs with 3.8.8)

Dependencies

Run: curl -o- https://raw.githubusercontent.com/vmware/build-tools-for-vmware-aria/main/health.sh | bash and paste the output here:

curl -o- https://raw.githubusercontent.com/vmware/build-tools-for-vmware-aria/main/health.sh | bash

Server

  • vRealize Automation Version:
  • vRealize Orchestrator Version:
  • vRealize Operations Version:
  • vRealize Log Insight Version:

Failure Logs

$ mvn clean install -f pom.xml -pl .
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.vmware.pscoe.maven.plugins:vrealize-package-maven-plugin:maven-plugin:4.2.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.vmware.pscoe.iac:artifact-manager:jar -> duplicate declaration of version ${revision} @ com.vmware.pscoe.maven.plugins:vrealize-package-maven-plugin:${revision}, C:\DEV\Github\btva\build-tools-for-vmware-aria\maven\plugins\vrealize\pom.xml, line 35, column 15
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.vmware.pscoe.iac:installer:jar:4.2.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.vmware.pscoe.iac:artifact-manager:jar -> duplicate declaration of version ${revision} @ com.vmware.pscoe.iac:installer:${revision}, C:\DEV\Github\btva\build-tools-for-vmware-aria\package-installer\pom.xml, line 46, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] 
[INFO] ------------------------< com.vmware.pscoe:iac >------------------------
[INFO] Building Build Tools for VMware Aria 4.2.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
Downloading from central: https://emea1.packages.broadcom.com/artifactory/pscoe-mvn-prod-virtual/org/apache/maven/plugins/maven-clean-plugin/3.2.0/maven-clean-plugin-3.2.0.pom
Downloaded from central: https://emea1.packages.broadcom.com/artifactory/pscoe-mvn-prod-virtual/org/apache/maven/plugins/maven-clean-plugin/3.2.0/maven-clean-plugin-3.2.0.pom (5.3 kB at 2.9 kB/s)
Downloading from central: https://emea1.packages.broadcom.com/artifactory/pscoe-mvn-prod-virtual/org/apache/maven/plugins/maven-plugins/35/maven-plugins-35.pom
Downloaded from central: https://emea1.packages.broadcom.com/artifactory/pscoe-mvn-prod-virtual/org/apache/maven/plugins/maven-plugins/35/maven-plugins-35.pom (9.9 kB at 10 kB/s)
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ iac ---
[INFO] 
[INFO] --- flatten:1.7.0:clean (flatten.clean) @ iac ---
[INFO] 
[INFO] --- license:2.5.0:update-file-header (manage-licenses) @ iac ---
[INFO] Adding a license repository jar:file:/C:/Users/mp059346/.m2/repository/org/codehaus/mojo/license-maven-plugin/2.5.0/license-maven-plugin-2.5.0.jar!/META-INF/licenses
[INFO] adding extra resolver file:C:\DEV\Github\btva\build-tools-for-vmware-aria/licenses
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.563 s
[INFO] Finished at: 2025-02-27T10:39:08+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.5.0:update-file-header (manage-licenses) on project iac: could not obtain the license repository: Illegal character in opaque part at index 7: file:C:\DEV\Github\btva\build-tools-for-vmware-aria/licenses -> [Help 1]

Related issues and PRs

Additional Context

The error does not appear when the main pom.xml is edited to replace
<licenseResolver>file:${main.basedir}/licenses</licenseResolver>
with a specific path with forward slashes ('/') instead of backslashes, e.g:
<licenseResolver>file:C:/DEV/Github/btva/build-tools-for-vmware-aria/licenses</licenseResolver>
However another issue occurs - on executing mvn clean install -f pom.xml, there is a test failure for "Check empty vro action inside js files", possibly due to the way paths are generated in the test:
https://github.com/vmware/build-tools-for-vmware-aria/blob/main/typescript/vropkg/e2e/src/comments.ts

@bcpmihail bcpmihail added kind/bug Something isn't working os/windows triage/needed Needs to be discussed by project maintainers area/maven Relates to maven changes labels Feb 27, 2025
@bcpmihail bcpmihail changed the title Issues building BTVA on WIndows Issues building BTVA on Windows Feb 27, 2025
@bcpmihail
Copy link
Contributor Author

See https://github.com/vmware/build-tools-for-vmware-aria/tree/fix/635-windows-issues
Contains fix in definitionCleaner.ts resolving the failing test "Check empty vro action inside js files "
Still using workaround (hardcoded path for licenseResolver) while investigating this approach as solution to pom issue:
https://www.bennorthrop.com/Snippets/string-replace-in-maven-with-regex.php
Also pending investigation on why testbed creation fails - see:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/maven Relates to maven changes kind/bug Something isn't working os/windows triage/needed Needs to be discussed by project maintainers
Projects
None yet
Development

No branches or pull requests

1 participant