Alfira
Alfira

Reputation: 113

Does Eclipse IDE support Maven configs from .mvn folder like jvm.config per project?

I have a Maven project in Eclipse IDE. In the root of this maven project there is .mvn folder with jvm.config file (supported in Maven 3.3.1+). This file contains SSL truststore and password

-Djavax.net.ssl.trustStore="C:/certificates/cert.jks"
-Djavax.net.ssl.trustStorePassword=***

Certificate exists in the mentioned directory. I have settings.xml file in my userhome/.m2 folder. Eclipse configured to use external Maven installation (excluding dependency resolution, because Eclipse IDE uses embedded Maven for that forcibly). Everything has been configured properly.

  1. When I run mvn clean package from command line, then it works fine - all dependencies are downloaded from company Nexus repo and remote repositories.
  2. If I import certificate into the installed JDK, then again it works. (assume .mvn is missing in the project root)
  3. If I import certificate into Eclipse JDK plugin, then it works. (assume .mvn is missing in the project root)
  4. If I provide trustStore and password in command line like below, then again it works. (assume .mvn is missing in the project root)
mvn -Djavax.net.ssl.trustStore="C:/certificates/cert.jks -Djavax.net.ssl.trustStorePassword=*** clean package
  1. If I import this Maven project into IntelliJ IDEA, then again it works. (with .mvn folder and jvm.config file)

I have many workarounds, but want to know exactly about .mvn with nested configs. How to configure Eclipse IDE (or Eclipse Maven plugin) to use that .mvn folder with all nested configs for successful dependency resolution?

Tested this with

Upvotes: 0

Views: 354

Answers (1)

Francois Marot
Francois Marot

Reputation: 1195

It may help you despite not answering the question directly: if your IT has distributed the certificates on your windows computer but Java does not see them and forces you to use a specific jks file, an alternative may be to define this env variable:

JAVA_TOOL_OPTIONS=-Djavax.net.ssl.trustStoreType=Windows-ROOT

if your windows is configured with the certs, it will allow Java to access it without a specific aditional file.

Upvotes: 1

Related Questions