0

I have maven project where i need to add local jar as the dependency.

I have stored my jar into my maven folder using:

mvn install:install-file -Dfile=path\to\file\framework-0.0.0.1-SNAPSHOT.jar -DgroupId=test -DartifactId=test -Dversion=0.0.0.1 -Dpackaging=jar -DgeneratePom=true

I have read that adding dependencty to POM file is deprecated ( didnt even work for me ). So how should i include this dependency in my project? My settings.xml looks like:

<localRepository>C:\project\.m2</localRepository>
<mirrors>
       ....
</mirrors>

<servers>
    <server>
         ....
    </server>
    <server>
        ....
    </server>
</servers>

If i try to jusat use classes from the jar, Intelijj cannot find. So how should i add this dependency to my maven project?

Thanks for answers

2
  • maven system scope can help? Commented Oct 23, 2020 at 8:35
  • POM dependency can't deprecate, it's a fundamental concept of Maven projects. Commented Oct 23, 2020 at 9:25

1 Answer 1

2

You installed the dependency in the local repository.

So you can use it as any other dependency by declaring it as <dependency> in the <dependencies> area of your pom.xml.

BTW: Don't use system scope.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.