0

I'm currently working on a Maven project. In my pom.xml, I have to specify my local path for JDK as following :

<dependency>
        <groupId>jdk.tools</groupId>
        <artifactId>jdk.tools</artifactId>
        <version>${java.version}</version>
        <scope>system</scope>
        <systemPath>C:/Program Files/Java/jdk1.8.0_202/lib/tools.jar</systemPath>
    </dependency>

I'm using Java 1.8.0_202. But my colleague, whom I work with on the project, uses Java 1.8.0_144. Is there a way to variablize the local Java path so that we don't have to modify it each time we get one another's modifications on the code from Git?

Ondra K.
  • 2,767
  • 4
  • 23
  • 39
  • 1
    First question would be: why do you have to specify the path to your JDK in your POM file? There should be no need for that in a typical project. – Robby Cornelissen Apr 18 '19 at 09:56
  • User dependent settings are in general in [settings.xml](http://maven.apache.org/settings.html). – Joop Eggen Apr 18 '19 at 11:46

1 Answers1

1

For the local java in pom.xml concern you can use refer to this, This already covers how maven works. But your concern about Git, you can use .gitignore command to ignore changes in pom.xml file refer to this tutorial.

Muhammad Ahmed
  • 182
  • 2
  • 6