How can I add secret dependencies to a Clojure project on Heroku without putting them in a public repository?
1) Create a folder in the root directory of the project
mkdir repo
2) Install dependencies to the repo using the maven command
mvn org.apache.maven.plugins:maven-install-plugin:2.5.1:install-file -Dfile=path-to-your-artifact-jar
-DgroupId=your.groupId
-DartifactId=your-artifactId
-Dversion=version
-Dpackaging=jar
-DlocalRepositoryPath=path-to-specific-local-repo
3) Be careful to remove .pom and jar from .gitignore
4) git add repo
5) Edit project.clj and add the line
:local-repo "repo"
Leiningen will look for your secret dependencies in repo and in public repositories for all other dependencies.
Related
When I use this command:
mvn dependency:sources
Maven will attempt to download source code for each of the dependencies in my pom file (cf. Get source JARs from Maven repository). But these files are downloaded into my local cache ~/.m2.
Is there a plugin/way to create an archive into target of my project with all dependencies sources ?
I have a Maven project that works just fine.
In order to triage an issue, I manually patched a jar to add debug logging and then copied it to the local Maven repo directory. I made subsequent changes to the jar file to add more debugging and did a mvn install:install-file since that seemed more "official".
Note that I did not change the coordinates at all (I know that artifacts are meant to be immutable, but I did not want to change pom.xmls).
My question is: when (if ever) will Maven overwrite this patched jar with the one in the remote Maven repository which is considered the source of truth?
There are only three scenarios in which that jar can be overwritten:
If you delete the jar from your local m2 repository, it will be downloaded from the remote repository the next time you build your maven project.
If you build your maven project with '-U' option. Doing this will force maven to update the dependencies from remote repository.
If you perform an mvn install on the same artifact(updated code) with the same version.
Once I change the repository url and I want to test how this center downloading jars (in local repo I have downloaded jars and I want to delete those jars and restart download).
Does any maven plugin or command support this?
I think you need:
mvn dependency:purge-local-repository
See Purging local repository dependencies
I am new to intelliJ and trying to import maven projects. IntelliJ downloads all the jars from my local maven repo to the system/jars folder. Which is getting huge.
How can i make sure it does not copies the jar from local maven repo to system/jars folder instead should resolve dependency from the local maven repo only
Today I'v found that my system/jars folder is 6.6GB, maven dependencies which were updated are kept in jars folder even when not used.
Is there a possibility to clean this folder from old dependencies?
Also it would be better to use dependencies from local maven repo rather than making duplicates.
I had some repo in my project's main module' pom.xml file which maven couldn't download any library (artifact) from. I made a decision to remove that repo from pom.xml and use another one. When I run command : mvn clean install - it print out that it is trying to download libraries from that first bloody ( already deleted from project configuration {pom.xml file} ) repository ....
How to make maven forget about deleted and even not mentioned in project repositories ?
Thanks a lot!
One of the reasons could be that this repository is also mentionned in your maven settings. This file is by default in .m2/settings.xml in your personal directory.