0

Hi I have obviously an Maven setup problem and not enough information for a solution.

I run an AWS CodeBuild which build my Springboot app and it worked for some month.

No one week later with an deployment I got this error and confused about it.

Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/1.5.9.RELEASE/spring-boot-starter-parent-1.5.9.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for de.project:communication:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from/to project-mvn-repo (s3://project-mvn-repo/release): Cannot access s3://project-mvn-repo/release with type default using the available connector factories: BasicRepositoryConnectorFactory and 'parent.relativePath' points at no local POM @ line 18, column 10
@ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR] 
[ERROR] The project de.project:communication:0.0.1-SNAPSHOT (/codebuild/output/src807440776/src/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for de.project:communication:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from/to project-mvn-repo (s3://project-mvn-repo/release): Cannot access s3://project-mvn-repo/release with type default using the available connector factories: BasicRepositoryConnectorFactory and 'parent.relativePath' points at no local POM @ line 18, column 10: Cannot access s3://project-mvn-repo/release using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: s3
[ERROR] -> [Help 2]
[ERROR] 

I dont know what happend meanwhile. All what changed from my side was a Text in the project.

The Build Server have Inet access and can curl the Maven-Nexus. All rights, S3, CodeBuild and server settings stay unchanged.

Have anyone an idea how to approach the issue? Since the error message isn´t very obvious for me?

Maybe an certain POM setting whats needed? Any hint is appreciate!

Thanks in advance! Gregor

ADDITION:

the use buildspec.yaml:

The error happens on: - mvn -s m2/settings.xml clean install

...
phases:
  install:
    commands:
      - echo install phase for ${project}-${image} at `date`
      - apt-get update -y
      - apt-get install -y software-properties-common
      - add-apt-repository ppa:openjdk-r/ppa
      - apt-get update -y
      - apt-get install -y openjdk-8-jdk
      - wget http://www-eu.apache.org/dist/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz
      - tar xzvf apache-maven-3.5.2-bin.tar.gz -C /opt/
      - export PATH=/opt/apache-maven-3.5.2/bin:$PATH
  pre_build:
    commands:
      - echo pre-build phase for ${project}-${image} at `date`
      - echo Maven version 
      - mvn -version
  build:
    commands:
      - echo build phase for ${project}-${image} at `date`
      - curl https://repo.maven.apache.org
      - mvn -s m2/settings.xml clean install
  post_build:
    commands:
    ...

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>

    <groupId>de.project</groupId>
    <artifactId>communication</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>communication</name>
    <description>Communication Utils for projecth</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <spring-cloud.version>Edgware.RELEASE</spring-cloud.version>
    </properties>


    <repositories>
        <repository>
            <id>project-mvn-repo</id>
            <name>S3 MVN project Release Repository</name>
            <url>s3://project-mvn-repo/release</url>
        </repository>
    </repositories> 

    <dependencies>
    ...
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
            </plugin>
        </plugins>

        <!-- For pushing & getting mvn repo from S3 -->
        <extensions>
            <extension>
                <groupId>org.zalando.org.springframework.build</groupId>
                <artifactId>aws-maven</artifactId>
                <version>5.0.0.RELEASE-zal-2</version>
            </extension>
        </extensions>
    </build>  
</project>

Then there is still a "settings.xml" with the S3 credentials.

UPDATE:

After switching to public repo access via https I have a similar issue. So its not directly S3 related.

error:

[INFO] Scanning for projects...
Downloading from project-mvn-repo: https://s3.eu-central-1.amazonaws.com/project-mvn-repo/release/org/springframework/boot/spring-boot-starter-parent/1.5.9.RELEASE/spring-boot-starter-parent-1.5.9.RELEASE.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/1.5.9.RELEASE/spring-boot-starter-parent-1.5.9.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for de.project:communication:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from/to project-mvn-repo (https://s3.eu-central-1.amazonaws.com/project-mvn-repo/release): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty and 'parent.relativePath' points at no local POM @ line 18, column 10
Gregor Sklorz
  • 1,645
  • 2
  • 19
  • 27
  • This link may help you https://stackoverflow.com/questions/24896522/deploying-maven-dependencies-to-s3-no-connector-available Possible issue report at https://github.com/spring-projects/aws-maven/issues/25 – raevilman Mar 24 '18 at 17:11
  • Hey raevilman. Thanks for the links. I already checked them before. But on both solutions it still try to load the Spring-Parent from my local mvn-repo. Not from the global. – Gregor Sklorz Mar 25 '18 at 15:46
  • The java security exception makes me think your cacerts store is not set up correctly for access over HTTPS: https://stackoverflow.com/a/29313285/5095975 – Clare Liguori Mar 26 '18 at 22:17
  • Thanks @ClareLiguori I was not really the issue, but lead me to the right! – Gregor Sklorz Mar 28 '18 at 11:41

1 Answers1

1

Solved:

The problem were the Ubuntu certificates which needed an update to work properly. Dont know why it works before. But it explains why it worked on my windows machine.

But adding the command:

 update-ca-certificates -f

before the maven build command solved it for me.

Oh... and I changed

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.9.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

into

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.9.RELEASE</version>
    <relativePath></relativePath> <!-- lookup parent from repository -->
</parent>

maybe that helped too :-)

Gregor Sklorz
  • 1,645
  • 2
  • 19
  • 27