0

I want to use the local repo provided by IntelliJ to add several jar files to a Maven project, but I have no clue how. I tried to look at the guides on apache.org but they were extremely unclear to me.

What I gathered from the guides was that I had to put something like this in the pom.xml...

...
  <build>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.4</version>
        <executions>
            <execution>
                <id>cb-1.12</id>
                <goals>
                    <goal>install-file</goal>
                </goals>
                <configuration>
                    <file>F:\path\to\file.jar</file>
                    <groupId>agroup</groupId>
                    <artifactId>anartifact</artifactId>
                    <version>1.12</version>
                </configuration>
            </execution>
            <execution>
                <id>cb-1.11</id>
                <goals>
                    <goal>install-file</goal>
                </goals>
                <configuration>
                    <file>F:\path\to\file.jar</file>
                    <groupId>agroup</groupId>
                    <artifactId>anartifact</artifactId>
                    <version>1.11</version>
                </configuration>
            </execution>
            ...the same thing several more times...
        </executions>
    </plugin>
  </build>
...

I added that and tried adding the dependencies but IntelliJ was unable to resolve them. I tried running it anyway thinking maybe the plugin had to add them first and nothing happened except for the wall of errors about classes not being found. The local repo folder didn't have the new group either. I'm not sure what else to try.

PotatoCode
  • 53
  • 1
  • 6
  • It is not clear what you want to do. E.g. `I want to use the local repo provided by IntelliJ to add several jar files to a Maven project` what do you mean by `provided by IntelliJ` here? – Andrey Feb 08 '19 at 15:22
  • Do you want to add jars to your [local Maven repository](https://www.baeldung.com/maven-local-repository)? See https://stackoverflow.com/questions/4955635/how-to-add-local-jar-files-to-a-maven-project – Andrey Feb 08 '19 at 15:24
  • @Andrey I've already seen that post and added to my pom based on the snippet above and nothing happened. I need clarification on what it means because I'm clearly not interpreting it correctly. – PotatoCode Feb 08 '19 at 18:00
  • in the settings > maven screen make certain you're pointing to the correct maven instance + repository location. You're likely still using the embedded one. – Kristof Plennings Feb 22 '19 at 07:02

0 Answers0