-
Notifications
You must be signed in to change notification settings - Fork 435
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
Specify MAVEN_OPTS #455
Comments
Are you able to open your project in Eclipse? |
Can you try changing
|
Hello, Unfortunately, vmargs didn't work and we receive the same errors when importing the project into Eclipse. We believe this is related to m3e not respecting MAVEN_OPTS environment variable. Maybe there are some properties we could tweak and get it working. Listed here: http://www.eclipse.org/m2e/documentation/m2e-faq.html#how-to-connect-to-https-repositories however, we've decided to move the few proprietary jars we had in our nexus repository to the lib folder of our project, and use maven central. It would be great if there were an easy way to make this work. :) Thanks, |
Any idea when this will be fixed? As there is a issue with setting MAVEN_OPTS and the agent simply ignore them and never uses it and causes one of our largest build to fail due to out-of-memory. Please advise. Thanks, |
Adding our Agent is on RHEL 7. |
@jaschenk MAVEN_OPTS support would probably require some changes in the m2e project upstream. |
Where is java.jdt.ls.vmargs located? Where should this be set? Actual MAVEN_OPTS is where you would place the standard memory settings and other options to Maven. Why isn't the Build Agent recognizing MAVEN_OPTS and overwriting with a default? |
No matter what is specify the Build Agent does not taken in account any MAVEN_OPTS overrides and using [debug]MAVEN_OPTS is now set to -Xmx1024m for whatever reason and unable to find where this is being set on the VSTS Agent. Very frustrating. I guess I can edit the mvn script, but you shouldn't have to do that! |
@jaschenk If your problem is with running Maven through a Build task, then this is a vscode issue, upstream. I don't know why the environment variables are not available to the build task (maybe try launching vscode from a terminal). Other than that, environment variables can be set through the |
I am having the same problem with not being able to specify what I already have in MAVEN_OPTS to work with the java language server. I need to specify the javax.net.ssl.trustStore and trustStorePassword parameters in order to allow maven to work with our internal nexus server. It is causing errors in my pom.xml to show up in vs code. mvn compile works fine on a terminal, because all environment variables are setup when running it that way. I have tried the java.jdt.ls.vmargs setting, have cleaned the java language server workspace, and have even tried to use the terminal.integrated.env.windows setting to no avail.
The Edit 1: strikethroughs Edit 3: After trying the same thing for the 147th time, it appears to work now. I confirmed by deleting the package from my local repository, and cleaning the java language server workspace several times to try again (deleting the package each time). I also did this and completely rebooted to make sure it wasn't that VS code was holding on to some environment variable. I don't understand why it wasn't working, but I think the java.jdt.ls.vmargs is the way to go for this! |
I am running into the same issue but specifying the keystore in
Is this incorrect? |
@snjeza is this something you have tested? |
It works for me.
|
@BobLuursema How have you created your keystore? |
@snjeza the Lombok jar shouldn't be related to the issue. To start from the beginning, in my POM I get errors due to the PKIX path building when Maven tries to access our internal Maven repository. To fix this I have downloaded our CA root certificate via Chrome and I have imported it in a keystore created via (The Lombok jar also happens to be in the args for the language server to understand the code that Lombok adds). |
@BobLuursema Could you check if your internal Maven repository has been properly configured at https://whatsmychaincert.com/?<your_server> related issue: eclipse/lemminx#419 |
@snjeza unfortunately I can't use that as our Maven repository is not accessible from the public internet. But I can't imagine that being an issue since I have no issues when using Maven from the command line. |
@BobLuursema Could you set the following property:
and attach your workspace log. |
@fbricon any idea if this is fixed ? |
OK :) I can reproduce it ... running VSCode-java in Che. |
@sunix could you, please, describe how to reproduce the issue. |
@snjeza not visible for non redhatter yet https://docs.google.com/document/d/1PHcEn3zZHqprRN-ATr11OBlRyTAwiv4knXVYRbKqGUA/edit?usp=sharing edit: eclipse-che/che#15503 (comment) This a doc where I am describing how to setup Che and Maven with private repositories and self signed certificate. I will see if I can make it public but basically:
Then making various test (jdt.ls and command line) |
@fbricon this is relevant for air-gapped scenarios in the imminent CRW 2.1 release. Is there a possibility to get a fix for this soon? |
m2e uses the okhttp client that verifies a hostname as described at https://www.ietf.org/rfc/rfc2818.txt. @sunix could you try the following:
instead of
|
thanks @snjeza I am currently testing it. |
... I am trying to find a more recent version |
@sunix I have used Fedora 30
|
@sunix you can try the following command and openssl 1.0.2:
|
Hello, it works! thanks @snjeza . |
Maven CLI doesn't verify a hostname. I think, it is a security hole in Maven CLI. |
I think we just need to document it well in a doc or a FAQ rather than adding a property to skip it. Could also be an preference in vscode-java to skip hostname verification in case user could not change the certificate (it happens that user doesn't have permission) |
That has to be done in the aether-connector-okhttp project. The preference would be added to java.jdt.ls.vmargs. @fbricon What do you think? |
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
Steps To Reproduce
[attach a sample project reproducing the error]
attach logs
Current Result
Expected Result
Additional Informations
The text was updated successfully, but these errors were encountered: