mavengoogle-cloud-platformgoogle-cloud-storagemaven-wagon-plugin

Parent project hosted on Google Cloud Storage is not accessible


I have spring boot parent project hosted on Google Cloud Storage. I am using GoogleStorageWagon. I am able to deploy parent to GCS, But I am not able to download it.

Child project pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.myorg.common</groupId>
        <artifactId>myorg-starter-parent</artifactId>
        <version>1.0.0</version>
    </parent>

    <artifactId>test-project</artifactId>
    <version>1.0.0</version>
    <name>test-service</name>


    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
    </dependencies>
    <build>
        <extensions>
            <extension>
                <groupId>com.gkatzioura.maven.cloud</groupId>
                <artifactId>google-storage-wagon</artifactId>
                <version>1.0</version>
            </extension>
        </extensions>
    </build>
    <repositories>
        <repository>
            <id>com.myorg.common</id>
            <url>gs://myorg-library</url>
        </repository>
    </repositories>
</project>

Error I am having is as below.

Error

I've tried changing bucket policies as well as different account with admin access. But, I'm not able to resolve.


Solution

  • For anyone, who is having this problem,

    Maven was trying to find google-storage-wagon in GCR, which was not hosted that. In order to tell maven to download this from Maven central, I had to this extension in .mvn/extensions.xml project folder.

    .mvn/extensions.xml file will look like below:

    <extensions>
        <extension>
            <groupId>com.gkatzioura.maven.cloud</groupId>
            <artifactId>google-storage-wagon</artifactId>
            <version>1.0</version>
        </extension>
    </extensions>
    
    

    Now, maven will download this plugin from maven central and after that it will download parent pom.xml from GCR using this plugin.