jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

Can't start quickstart with no additional config #1568

Closed Riduidel closed 5 years ago

Riduidel commented 6 years ago

Summary

Jenkins-X can't build the Spring boot quick-start because it doesn't mirror Maven Central

Steps to reproduce the behavior

On a newly created Jenkins-X environment, run

  1. jx create spring -d web -d actuator and answer all questions the wizard asks
  2. Let Jenkins build the application

Jx version

The output of jx version is:

NAME               VERSION
jx                 1.3.185
jenkins x platform 0.0.2267
kubernetes cluster v1.9.7-gke.6
kubectl            v1.10.3
helm client        v2.9.1+g20adb27
helm server        v2.10.0+g9ad53aa
git                git version 2.17.0.windows.1

Kubernetes cluster

GKE cluster created using command

gcloud container clusters create $K8S_CLUSTER_NAME \
        --preemptible \
        --enable-autoscaling --max-nodes=10 --min-nodes=3 \
        --machine-type=n1-standard-1

Operating system / Environment

Running on Windows with CygWin (useless, but I tried to install istio)

Expected behavior

The Jenkins build should succeed

Actual behavior

The Jenkins build fails with the following error message

[INFO] Scanning for projects...
[INFO] Downloading from nexus: http://nexus/repository/maven-group/org/springframework/boot/spring-boot-starter-parent/2.0.4.RELEASE/spring-boot-starter-parent-2.0.4.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.adeo.prh:prh-archi-ndx-test-k8s-spring-boot:0.0.1-SNAPSHOT: Could not find artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.4.RELEASE in nexus (http://nexus/repository/maven-group/) and 'parent.relativePath' points at no local POM @ line 14, column 10
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.adeo.prh:prh-archi-ndx-test-k8s-spring-boot:0.0.1-SNAPSHOT (/home/jenkins/workspace/test-k8s-spring-boot_master-GFESOZFFBCRTBPMJC2FKLW4ECCKZYDJL5J2XL45GYXENLYSGYSZA/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.adeo.prh:prh-archi-ndx-test-k8s-spring-boot:0.0.1-SNAPSHOT: Could not find artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.4.RELEASE in nexus (http://nexus/repository/maven-group/) and 'parent.relativePath' points at no local POM @ line 14, column 10 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

I guess that, as a default, Nexus doesn't mirror/proxies maven central, which is, as far as as I understand, a bad idea since most Java artifacts are built using OSS dependencies.

So, could it be possible to have Nexus configured to proxy Maven Central as a default ?

In fact, after taking a look, maven central is configured, but the "maven-group" used in maven is not. After I've created the group myself, the build works correctly !

jstrachan commented 6 years ago

@Riduidel when you first installed Jenkins X was there no maven-group created? its all working fine for me here, I wonder what caused the maven group to not include maven central in your installation.

Does your pom.xml define any <repository> settings?

ccojocar commented 5 years ago

@Riduidel I am going to close this issue. In the current version of jx seems to be fixed. Thanks