Skip to content

Instantly share code, notes, and snippets.

@kamysheblid
Created June 12, 2023 20:39
Show Gist options
  • Save kamysheblid/011465f07c206e8e21881a989995ee7e to your computer and use it in GitHub Desktop.
Save kamysheblid/011465f07c206e8e21881a989995ee7e to your computer and use it in GitHub Desktop.
Fix for clojars and Maven block on Iranians Syrians, Koreans, Cubans, Russians, and soon billions more

The problem

clojars and maven repositories block IPs of countries that the west hates (ex. Iran) and this problem is only going to get worse as americans increasingly become more fascist. It’s obvious the Chinese are getting a block soon.

The fix

This is how to fix the issue. Use a Chinese, Iranian, or other mirror. You can find a local mirror (if it exists) by going to some search engine and searching “clojar mirror iran” or “maven mirror china” for whatever country you live in.

Maven/clojure fix

If you use /usr/bin/clojure and get dependencies from maven (it looks like this: clojure -Sdeps ‘{:deps {nrepl/nrepl {:mvn/version “1.0.0”} cider/cider-nrepl {:mvn/version “0.30.0”}}) then simply add a maven mirror.

For maven all settings are stored in $HOME/.m2/settings.xml so go there and add a mirror (like this Iranian one) in the settings file.

   <profiles>
	  <profile>
	      <id>iranrepo</id>
	      <repositories>
		  <repository>
		      <id>maven-iranrepo</id>
		      <url>https://maven.iranrepo.ir</url>
		  </repository>
	      </repositories>
	      <pluginRepositories>
		  <pluginRepository>
		      <id>maven-iranrepo</id>
		      <url>https://maven.iranrepo.ir</url>
		  </pluginRepository>
	      </pluginRepositories>
	  </profile>
   </profiles>

Clojars/lein Fix

For clojars (which is used in lein or leiningen) go to $HOME/.lein/profiles.clj and add a mirror for clojars

{:user {:plugin-repositories [["clojars" {:url "https://mirrors.ustc.edu.cn/clojars/"}]]}}
{:user {:plugin-repositories [["central" {:url "https://maven.iranrepo.ir"}]]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment