简体   繁体   中英

Maven Specify Source Location

Is there a way to tell maven where your sources are locally in a pom.xml with a relative path? We have lots of projects in our SVN repo, and locally I mirror the repository. In my IntelliJ IDEA I can do this and modify my local source code for a foreign dependency and its quite useful in some situations.

To be clear this is different from Can I configure sources location for Maven? in two ways. One its a few years later in time and two I want to use sources already existing locally that share the same relative path as in SVN.

My question is also different from I see that you can tell maven to download sources uploaded to your repository in this post Get source JARs from Maven repository because I dont want to involve our maven repo.

There are 2 directions for your question.

Direction I. Create own repostitory (It also called corporate repository )
1. Create own maven repository
See: https://maven.apache.org/guides/introduction/introduction-to-repositories.html ---> at section: Internal Repositories .
2. Inform IntelliJ IDEA use own repository in pom.xml file by figure out your repository address.


Direction II.
You want IntelliJ IDEA doesn't download existing artifacts from internet.

Yes, If artifacts are existing. IntelliJ IDEA import to your project automatically. You don't need do anything.

Local repository at: ...\\.m2\\repository (3 dots at the start, in Windows operating system only).

You also maybe want put your artifacts to ...\\.m2\\repository , and must follow Maven's predefined structure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM