Public Maven Repositories: Maven Central and More

Serving developers since 2016 Founder-run, no venture capital MFA, SSO and audit log on every plan

Every feature on every plan, with unlimited users. 14 days free. No credit card required.

Start free trial

Starting at $99/month billed annually.

The Maven Central repository URL is https://repo.maven.apache.org/maven2. Maven reads it by default, so you only add it to a pom.xml to be explicit. To find a library’s coordinates, search Central at search.maven.org.

Central is the biggest public Maven repository, not the only one. Here are the others worth knowing, and the XML to add each.

Publishing your own code?

Public repositories are for open-source libraries. For proprietary artifacts, CloudRepo hosts private Maven repositories, with every feature on every plan. Start free trial: 14 days free. No credit card required.

Leaving Nexus? cloudrepo-migrate copies your hosted Maven, npm, PyPI and Docker repositories (Nexus 3; Maven and npm from Nexus 2) into CloudRepo and checks every file against the original. Read the Nexus 3 migration guide

Leaving Artifactory? cloudrepo-migrate copies your local Maven and Generic repositories into CloudRepo and checks every file against the original. Read the JFrog Artifactory migration guide

Terminal window
pipx install cloudrepo-migrate

Understanding Apache Maven

Apache Maven is the de facto build tool for Java Virtual Machine (JVM) projects. It revolutionized dependency management by introducing:

  • Standardized project structure
  • Declarative dependency management
  • Consistent build lifecycle
  • Repository-based artifact distribution

Maven’s power lies in its ability to automatically download and manage project dependencies from repositories, eliminating the need to manually download and manage JAR files.

CloudRepo, JFrog Artifactory and Sonatype Nexus, side by side

Compare CloudRepo with
CloudRepo, JFrog Artifactory and Sonatype Nexus, side by side
Question CloudRepo Essentials JFrog Artifactory Cloud Pro Sonatype Nexus Pro Cloud
Entry price $99/month billed annually, $1,188 a year $150/month list price, billed monthly [1] $1,950/year plus consumption [2]
Included each month 10 GB storage and 250 GB transfer 25 GB, then $1.25/GB storage and transfer counted together [1] 25 GB, then $1.10/GB of consumption [2]
Users Unlimited, on every plan Typically up to 50 users how JFrog sizes Pro [1] New contracts are priced by consumption [3]
Support Human support, on every plan Community support: public documentation, a knowledge base and Stack Overflow [4] Pro lists enterprise support, SLA and migration services as available [2]
Single sign-on Included on all plans Not in Pro: JFrog lists SAML and OAuth sign-on for Enterprise X [4] SAML single sign-on on Pro [5]

Every feature on every plan

Start free trial Or compare your Sonatype or JFrog quote with ours

14 days free. No credit card required.

Starting at $99/month billed annually.

Sources (5): each vendor's own pages, read 2026-10-06 to 2026-10-21. Prices as each vendor listed them on the date shown.
  1. JFrog pricing, read (archived)
  2. Sonatype pricing, read (archived)
  3. Sonatype pricing, read
  4. JFrog pricing, read (archived) Community Support - Available for Free solutions and Pro subscriptions - JFrog maintains public documentation, knowledge base, and engages in conversations on Stack Overflow.Enterprise X is for organizations who need multi-site capabilities, uptime and support guarantees, and enterprise access controls (ie. OAuth, SAML, CName).
  5. Nexus Repository feature matrix, read

What Are Public Maven Repositories?

Public Maven repositories are servers that host software artifacts (JARs, POMs, sources, javadocs) that are freely downloadable. For a comprehensive overview of how Maven repositories work, including the differences between local, remote, and central repositories, see our complete guide to Maven repositories.

They distribute:

  • Open-source libraries
  • Framework releases
  • Development tools
  • Community-contributed projects

Key Characteristics

  • No Authentication Required: Most public repositories allow anonymous access
  • Free to Use: No cost for downloading artifacts
  • Globally Distributed: Often use CDNs for fast worldwide access
  • Immutable Artifacts: Once published, artifacts typically cannot be modified

Important: Always check the license agreement of any artifacts you use before adding them to your project’s dependencies. Open source doesn’t always mean free for commercial use.

Maven Central: The Primary Repository

Maven Central is the default and largest public repository, hosting over 10 million unique artifacts. It’s automatically configured in every Maven installation and serves as the primary source for most Java dependencies.

Key Features

  • Size: Over 10 million unique artifacts and growing
  • Security: HTTPS-only access, checksum verification
  • Search: Advanced search at search.maven.org

Using Maven Central

Maven Central is configured by default, but you can explicitly reference it:

<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
</repositories>

Publishing to Maven Central

Publishing to Maven Central requires:

  1. A verified namespace on Sonatype’s Central Portal
  2. Signed artifacts with GPG
  3. Complete POM with required metadata
  4. Sources and Javadoc JARs

OSSRH, the older route, is gone. Sonatype says “As of June 30, 2025 OSSRH has reached end of life and has been shut down” (OSSRH end of life, read 2026-11-23). You upload to the Central Portal instead: “After your namespace has been verified, you’re finally ready to start uploading components to Maven Central!” (Central Publisher Portal Guide, read 2026-11-23).

Other Notable Public Repositories

1. Clojars (Clojure Community)

The go-to repository for Clojure libraries:

<repository>
<id>clojars</id>
<url>https://repo.clojars.org/</url>
</repository>

2. Spring Repositories

Spring Framework maintains several repositories:

Release Repository:

<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/release</url>
</repository>

Milestone Repository:

<repository>
<id>spring-milestones</id>
<url>https://repo.spring.io/milestone</url>
</repository>

3. Atlassian Public Repository

For Atlassian SDK and plugins:

<repository>
<id>atlassian-public</id>
<url>https://maven.artifacts.atlassian.com/</url>
</repository>

4. JBoss Repository

Red Hat’s JBoss community artifacts:

<repository>
<id>jboss-public</id>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>

5. Google’s Android Repository

For Android development dependencies:

<repository>
<id>google</id>
<url>https://maven.google.com/</url>
</repository>

Best Practices for Using Public Repositories

1. Always Use HTTPS

Make sure all repository URLs use HTTPS to prevent man-in-the-middle attacks:

<!-- Good -->
<url>https://repo.maven.apache.org/maven2</url>
<!-- Avoid -->
<url>http://repo.maven.apache.org/maven2</url>

2. Implement Repository Mirroring

For enterprise environments, set up a repository manager to:

  • Cache artifacts locally
  • Reduce external network traffic
  • Improve build performance
  • Add security scanning

3. Version Pinning

Always specify exact versions in production:

<!-- Good: Exact version -->
<version>2.5.3</version>
<!-- Avoid: Version ranges -->
<version>[2.0,3.0)</version>

4. Keep Verification On

Maven checks artifact checksums and verifies the TLS certificate of every repository it contacts. Leave both switched on, but know what each one actually does.

A TLS verification failure stops the download. A checksum mismatch, by default, does not: Maven’s default policy is warn, so it logs Checksum validation failed and installs the artifact anyway, under a green BUILD SUCCESS. To make it fail the build, pass -C (--strict-checksums) or set <checksumPolicy>fail</checksumPolicy> on the repository.

And neither tells you who published the artifact. They are a floor, not a guarantee.

-Dmaven.wagon.http.ssl.insecure=true and -Dmaven.wagon.http.ssl.allowall=true disable certificate and hostname verification for every repository in the build, not just the one you were troubleshooting. If a corporate proxy intercepts TLS, import its CA into the JVM truststore rather than switching verification off. The keystore path differs by Java version: 9+ uses $JAVA_HOME/lib/security/cacerts, 8 uses $JAVA_HOME/jre/lib/security/cacerts. keytool will happily CREATE a keystore at a wrong path and report success, so resolve it before importing. The CloudRepo troubleshooting guide covers certificate errors.

5. Monitor Repository Health

  • Check repository status pages
  • Have fallback repositories configured
  • Monitor for deprecated artifacts

Security Considerations

License Compliance

Create a policy for acceptable licenses:

  • Apache 2.0, MIT: Generally safe for commercial use
  • GPL: May require open-sourcing your code
  • Commercial: May require licensing fees

Vulnerability Scanning

Set up automated scanning:

<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>8.0.0</version>
</plugin>

Supply Chain Security

  • Verify artifact signatures when available
  • Monitor for compromised dependencies
  • Use tools like Dependabot or Snyk

Performance Optimization

Local Repository

Maven caches artifacts in ~/.m2/repository. Optimize by:

  • Regular cleanup of old versions
  • Using SSD storage
  • Backing it up properly

Parallel Downloads

Enable parallel artifact downloads:

Terminal window
mvn -Dmaven.artifact.threads=10 clean install

Repository Order

Order repositories by reliability and speed:

  1. Local repository manager
  2. Maven Central
  3. Specialized repositories

Troubleshooting Common Issues

Repository Blocked

Some corporate networks block public repositories. Solutions:

  • Use corporate repository manager
  • Configure proxy settings
  • Request firewall exceptions

Artifact Not Found

When artifacts aren’t found:

  1. Verify the artifact exists (check search.maven.org)
  2. Check repository configuration
  3. Clear local repository cache
  4. Verify network connectivity

Slow Downloads

Improve download speeds by:

  • Using geographically closer mirrors
  • Caching artifacts locally
  • Upgrading network infrastructure

The Case for Private Repositories

While public repositories are excellent for open-source dependencies, private repositories are essential for:

  • Proprietary code protection
  • Internal library sharing
  • Snapshot version management
  • Access control and auditing

CloudRepo provides private Maven repositories, with:

  • Unlimited repositories
  • MFA, an Audit Log, and repository tokens scoped to the repositories you pick, on every plan

Conclusion

Public Maven repositories are the backbone of the Java ecosystem, providing free access to millions of artifacts. By following best practices for security, performance, and reliability, you can use these resources effectively while maintaining a secure and efficient build process.

For your own code you need a private repository. CloudRepo is one, at a fair price.

Quick Reference

Essential Repository URLs

  • Maven Central: https://repo.maven.apache.org/maven2
  • Spring Releases: https://repo.spring.io/release
  • Clojars: https://repo.clojars.org/
  • Google Android: https://maven.google.com/

Useful Commands

Fetch one artifact from your repositories:

Terminal window
mvn dependency:get -Dartifact=groupId:artifactId:version

Analyze dependencies:

Terminal window
mvn dependency:tree

Check for updates:

Terminal window
mvn versions:display-dependency-updates

Purge local repository:

Terminal window
mvn dependency:purge-local-repository

Start free trial. 14 days free. No credit card required.

Every feature on every plan, with unlimited users

14 days free. No credit card required.

Starting at $99/month billed annually.

Chris Shellenbarger, founder of CloudRepo

Founder-run since 2016, with no venture capital. A real person answers within one business day. Usually it's me.

Chris, founder of CloudRepo