All Projects β†’ salesforce β†’ bazel-maven-proxy

salesforce / bazel-maven-proxy

Licence: EPL-2.0 license
A local (read-only) proxy for Bazel to access Maven resources behind a secure repository or from the local Maven repository

Programming Languages

java
68154 projects - #9 most used programming language
Starlark
911 projects

Projects that are alternatives of or similar to bazel-maven-proxy

rules openapi
πŸƒ bazel rules for generating code from openapi specifications
Stars: ✭ 49 (+122.73%)
Mutual labels:  bazel, bazel-rules
Rules haskell
Haskell rules for Bazel.
Stars: ✭ 196 (+790.91%)
Mutual labels:  bazel, bazel-rules
Rules swift
Bazel rules to build Swift on Apple and Linux platforms
Stars: ✭ 151 (+586.36%)
Mutual labels:  bazel, bazel-rules
Bazel Tools
Reusable bits for Bazel
Stars: ✭ 109 (+395.45%)
Mutual labels:  bazel, bazel-rules
Rules python
Experimental Bazel Python Rules
Stars: ✭ 233 (+959.09%)
Mutual labels:  bazel, bazel-rules
Dbx build tools
Dropbox's Bazel rules and tools
Stars: ✭ 119 (+440.91%)
Mutual labels:  bazel, bazel-rules
Rules kotlin
Bazel rules for Kotlin
Stars: ✭ 162 (+636.36%)
Mutual labels:  bazel, bazel-rules
Platforms
Constraint values for specifying platforms and toolchains
Stars: ✭ 34 (+54.55%)
Mutual labels:  bazel, bazel-rules
Rules k8s
This repository contains rules for interacting with Kubernetes configurations / clusters.
Stars: ✭ 222 (+909.09%)
Mutual labels:  bazel, bazel-rules
Rules apple
Bazel rules to build apps for Apple platforms.
Stars: ✭ 217 (+886.36%)
Mutual labels:  bazel, bazel-rules
Rules nixpkgs
Rules for importing Nixpkgs packages into Bazel.
Stars: ✭ 88 (+300%)
Mutual labels:  bazel, bazel-rules
Rules rust
Rust rules for Bazel
Stars: ✭ 241 (+995.45%)
Mutual labels:  bazel, bazel-rules
Bazel Linting System
πŸŒΏπŸ’š Experimental system for registering, configuring, and invoking source-code linters in Bazel.
Stars: ✭ 63 (+186.36%)
Mutual labels:  bazel, bazel-rules
Rules apple line
LINE's Apple rules for Bazel
Stars: ✭ 151 (+586.36%)
Mutual labels:  bazel, bazel-rules
Rules grafana
Bazel rules for building Grafana dashboards
Stars: ✭ 46 (+109.09%)
Mutual labels:  bazel, bazel-rules
Bazel Skylib
Common useful functions and rules for Bazel
Stars: ✭ 153 (+595.45%)
Mutual labels:  bazel, bazel-rules
Rules go
Go rules for Bazel
Stars: ✭ 852 (+3772.73%)
Mutual labels:  bazel, bazel-rules
Rules codeowners
Bazel rules for generating CODEOWNERS from a workspace.
Stars: ✭ 31 (+40.91%)
Mutual labels:  bazel, bazel-rules
Rules protobuf
Bazel rules for building protocol buffers and gRPC services (java, c++, go, ...)
Stars: ✭ 206 (+836.36%)
Mutual labels:  bazel, bazel-rules
Rules kotlin
Bazel rules for Kotlin
Stars: ✭ 235 (+968.18%)
Mutual labels:  bazel, bazel-rules

Bazel Maven Proxy

A local (read-only) proxy for Bazel to access Maven resources behind a secure repository or from the local Maven repo

Features

  • Provides password-less access to Maven repositories requiring authentication via https://127.0.0.1:8499/maven/<repository-id>/... (the repository-id is used from ~/.m2/settings.xml)
  • Reads Maven authentication information from ~/.m2/settings.xml
  • Delivers artifacts from local Maven repository (~/.m2/repository) when available
  • Secure by default
    • Only listens locally on 127.0.0.1 (no external access possible)
    • Encrypted access with self-signed certificate via https://localhost:8499/
  • Unsecure access must be explicitly enable via command line parameter
  • Supports HTTP/2 access and can talk HTTP/2 or HTTP/1.1 to back-end Maven repositories

Getting Started

  • Build: bazel build //:maven_proxy
  • Run: bazel run //:maven_proxy -- --help (on Linux/macOS)

Different JDK

In case you need to use a different JDK you can create a .bazelrc-local file. Please have a look at .bazelrc for further instructions.

Command Line Arguments

Usage: bazel-maven-proxy [--local-maven-repository=PATH]
                         [--unsecure-port=<unsecurePort>]
                         [-c=PROXY-CONFIG-YAML] [-p=<port>]
                         [-s=MAVEN-SETTINGS-XML]
Starts the Bazel Maven Proxy
  -c, --config-file=PROXY-CONFIG-YAML
                      proxy configuration file with (additional) repositories to
                        proxy, i.e. path to proxy-config.yaml
  -h, --help          Show this help message and exit.
      --host=<host>   host name to listen on (default is 127.0.0.1, i.e. only
                        local connections allowed; use 0.0.0.0 to listen on all
                        interfaces)
      --local-maven-repository=PATH
                      path to Maven's local repository (default: ~/.
                        m2/repository/)
  -p, --port=<port>   port to listen on (HTTP/2 and HTTP 1.1 with self-sign
                        'localhost' certificate)
  -s, --maven-settings=MAVEN-SETTINGS-XML
                      path to Maven's settings.xml to read repositories and
                        authentication information (default is ~/.
                        m2/settings.xml)
      --unsecure-port=<unsecurePort>
                      non-secure (plain HTTP) port to listen on (default is none, set to >0 to
                        enable)
  -V, --version       Print version information and exit.

How to Use

Please ensure that your ~/.m2/settings.xml has an entry for your repository like this:

  ...
  <servers>
    <server>
      <id>mynexus</id>
      <username>...</username>
      <password>...</password>
    </server>
    <server>
      <id>central</id>
      <username>...</username>
      <password>...</password>
    </server>
  </servers>
  ...

  <profiles>
    <profile>
      <id>mynexus</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://my-central-mirror.internal.network.com/..</url>
        </repository>
        <repository>
          <id>mynexus</id>
          <url>https://my-nexus-repo.internal.network.com/..</url>
        </repository>
      </repositories>
      ...
    </profile>
  </profiles>

Then in Bazel (or anywhere else) you can refer to these as http(s)://localhost:<port>/maven/mynexus/.. and http(s)://localhost:<port>/maven/central/...

Alternatively to (or in addition to) ~/.m2/settings.xml one can also provide a YAML configuration file. See an example here for syntax.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].