Interface RemoteRepository


  • @Immutable(builder=false)
    public interface RemoteRepository
    A definition for a repository that can be added to projects.
    Since:
    2.0.0
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default @NotNull org.gradle.api.artifacts.repositories.MavenArtifactRepository addTo​(org.gradle.api.artifacts.dsl.RepositoryHandler handler)
      Register this repository with a repository handler.
      static @NotNull RemoteRepository all​(java.lang.String name, java.lang.String url)
      Create a repository that will publish/resolve both releases and snapshots.
      static @NotNull RemoteRepository all​(java.lang.String name, java.net.URI url)
      Create a repository that will publish/resolve both releases and snapshots.
      @NotNull java.lang.String name()
      The name of the repository.
      default boolean releases()
      Whether releases should be included in this repository.
      static @NotNull RemoteRepository releasesOnly​(java.lang.String name, java.lang.String url)
      Create a repository that will only publish/resolve releases.
      static @NotNull RemoteRepository releasesOnly​(java.lang.String name, java.net.URI url)
      Create a repository that will only publish/resolve releases.
      default boolean snapshots()
      Whether snapshots should be included in this repository.
      static @NotNull RemoteRepository snapshotsOnly​(java.lang.String name, java.lang.String url)
      Create a repository that will only publish/resolve snapshots.
      static @NotNull RemoteRepository snapshotsOnly​(java.lang.String name, java.net.URI url)
      Create a repository that will only publish/resolve snapshots.
      @NotNull java.net.URI url()
      The URL providing the remote location of this repository.
    • Method Detail

      • all

        @NotNull
        static @NotNull RemoteRepository all​(java.lang.String name,
                                             java.net.URI url)
        Create a repository that will publish/resolve both releases and snapshots.
        Parameters:
        name - the repository name
        url - the repository URL
        Returns:
        a new repository description
        Since:
        2.0.0
      • all

        @NotNull
        static @NotNull RemoteRepository all​(java.lang.String name,
                                             java.lang.String url)
        Create a repository that will publish/resolve both releases and snapshots.
        Parameters:
        name - the repository name
        url - the repository URL
        Returns:
        a new repository description
        Since:
        2.0.0
      • releasesOnly

        @NotNull
        static @NotNull RemoteRepository releasesOnly​(java.lang.String name,
                                                      java.net.URI url)
        Create a repository that will only publish/resolve releases.
        Parameters:
        name - the repository name
        url - the repository URL
        Returns:
        a new repository description
        Since:
        2.0.0
      • releasesOnly

        @NotNull
        static @NotNull RemoteRepository releasesOnly​(java.lang.String name,
                                                      java.lang.String url)
        Create a repository that will only publish/resolve releases.
        Parameters:
        name - the repository name
        url - the repository URL
        Returns:
        a new repository description
        Since:
        2.0.0
      • snapshotsOnly

        @NotNull
        static @NotNull RemoteRepository snapshotsOnly​(java.lang.String name,
                                                       java.net.URI url)
        Create a repository that will only publish/resolve snapshots.
        Parameters:
        name - the repository name
        url - the repository URL
        Returns:
        a new repository description
        Since:
        2.0.0
      • snapshotsOnly

        @NotNull
        static @NotNull RemoteRepository snapshotsOnly​(java.lang.String name,
                                                       java.lang.String url)
        Create a repository that will only publish/resolve snapshots.
        Parameters:
        name - the repository name
        url - the repository URL
        Returns:
        a new repository description
        Since:
        2.0.0
      • name

        @Parameter
        @NotNull
        @NotNull java.lang.String name()
        The name of the repository.

        This name should be provided in camelCase format.

        Returns:
        the internal repository name
        Since:
        2.0.0
      • url

        @Parameter
        @NotNull
        @NotNull java.net.URI url()
        The URL providing the remote location of this repository.
        Returns:
        the repository URL
        Since:
        2.0.0
      • releases

        @Default
        @Parameter
        default boolean releases()
        Whether releases should be included in this repository.
        Returns:
        whether releases should be published/resolved
        Since:
        2.0.0
      • snapshots

        @Default
        @Parameter
        default boolean snapshots()
        Whether snapshots should be included in this repository.
        Returns:
        whether snapshots should be published/resolved
        Since:
        2.0.0
      • addTo

        @NotNull
        default @NotNull org.gradle.api.artifacts.repositories.MavenArtifactRepository addTo​(org.gradle.api.artifacts.dsl.RepositoryHandler handler)
        Register this repository with a repository handler.
        Parameters:
        handler - the handler to register with
        Returns:
        the registered repository
        Since:
        2.0.0