0

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.

Nirav
  • 602
  • 1
  • 10
  • 28
  • Have you specified the parent path of the modules? The error message states "cannot access xxxx with type default using the available connector factories: BasicRepositoryConnectorFactory and 'parent.relativePath' points at wrong local pom." From what I've seen about this issue, the parent element has a relativePath element that you need to point to the directory of the parent. For example: ../pom.xml under . – Samuel N Jun 04 '19 at 15:53
  • Thanks for the reply. It turned out that I had to put `google-storage-wagon` in **.mvan/extensions.xml** to download plugin first from maven central. After downloading it from maven central, I was able to download parent from GoogleCloudStorage. – Nirav Jun 05 '19 at 12:43

1 Answers1

2

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.

Nirav
  • 602
  • 1
  • 10
  • 28
  • Yes, I wasn't convinced that this was a permissions issue with Google Cloud Storage, because according to the [official guide](https://egkatzioura.com/2018/04/09/host-your-maven-artifacts-using-google-cloud-storage/) for hosting your maven artifacts using Google Storage Wagon, the maven wagon is located on the maven repository. The google-storage-wagon should be downloaded through the maven central repo. – Samuel N Jun 05 '19 at 16:47
  • Yes, google-storage-wagon needs to be downloaded from maven central repo first. – Nirav Jun 06 '19 at 12:06