redhat-developer / redhat-developer/vscode-java

Specify MAVEN_OPTS

Ouverte
#455 34 commentaires 4 réactions 1 personne assignée Voir sur GitHub

@snjeza y travaille déjà.

Depuis le 29/1/2020.

Maven preferences upstream
Langage dominant
TypeScript
Étoiles
2.3k
Forks
546
Merge moyen
20 h 1 min
PR mergées (30 j)
11

Description

Hi All,

How do we specify maven command line arguments or have maven read MAVEN_OPTS env variable inside VSCode?

We have a custom nexus server that is a mirror of maven central repository setup in our settings.xml file. When opening our java project in VSCode hundreds of problems are reported stating:
org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact X from/to Nexus (URL) PKIX path building failed: ... unable to find valid certification path for request target.

NOTE: When we remove our settings.xml file and Maven central is used, everything downloads properly except some proprietary jars we need which are not in maven central.

We have added the certificate to the Java cacerts file. We also have MAVEN_OPTS environmental variable which specifies a truststore with the proper certificates.

PS C:\workspace\Apps> $Env:MAVEN_OPTS -Djavax.net.ssl.trustStore=C:\Users\mashl\.m2\maven-trust.jks -Djavax.net.ssl.trustStorePassword=maven

Everything builds 100% successful and all jars are downloaded from our NEXUS server from the command line.

PS C:\workspace\806Apps> mvn clean install -P all-projects-dev ... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] dependencies ................................... SUCCESS [ 0.249 s] [INFO] JavaTypeScriptModels ............................... SUCCESS [ 2.867 s] [INFO] Common Utilities and Components SUCCESS [ 7.600 s] [INFO] Core ................................. SUCCESS [ 8.633 s] [INFO] Apps ............................................ SUCCESS [ 0.017 s] [INFO] WebApp .................................. SUCCESS [02:21 min] [INFO] p4lcore ............................................ SUCCESS [ 6.371 s] [INFO] Services ........................................ SUCCESS [ 4.537 s] [INFO] Task Scheduler ................................. SUCCESS [ 45.468 s] [INFO] Web Services ................................... SUCCESS [ 9.780 s] [INFO] IRWeb ...................................... SUCCESS [ 34.051 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 04:21 min [INFO] Finished at: 2018-03-01T15:11:16-06:00 [INFO] Final Memory: 193M/1535M [INFO] ------------------------------------------------------------------------ PS C:\workspace\806Apps>

Environment
  • Operating System: Windows 10
  • JDK version: 1.8.0_162 (C:\Program Files\Java\jdk1.8.0_162)
  • Visual Studio Code version: 1.20.1
  • Java extension version: 0.20.0
Steps To Reproduce
  1. Open Java project folder in VSCode
  2. Have C:\Users\mashl.m2\settings.xml specify the mirror to our repository.

[attach a sample project reproducing the error]
attach logs

Current Result
Expected Result
Additional Informations

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.