-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jitpack dependency is not resolved #2589
Comments
I have similar issue Azure Kubernetes version 1.19.11 i run a simple test integration which references a jitpack dependency containing a processor and some test-classes kubectl describe integration test Name: test
Namespace: default
Labels: <none>
Annotations: <none>
API Version: camel.apache.org/v1
Kind: Integration
Metadata:
Creation Timestamp: 2021-08-28T07:52:13Z
Generation: 1
Managed Fields:
API Version: camel.apache.org/v1
Fields Type: FieldsV1
fieldsV1:
f:status:
.:
f:conditions:
f:dependencies:
f:digest:
f:kit:
f:lastInitTimestamp:
f:phase:
f:platform:
f:profile:
f:runtimeProvider:
f:runtimeVersion:
f:version:
Manager: kamel
Operation: Update
Time: 2021-08-28T07:52:13Z
API Version: camel.apache.org/v1
Fields Type: FieldsV1
fieldsV1:
f:spec:
.:
f:dependencies:
f:sources:
Manager: kamel.exe
Operation: Update
Time: 2021-08-28T07:52:13Z
Resource Version: 25481282
Self Link: /apis/camel.apache.org/v1/namespaces/default/integrations/test
UID: 283f02cb-f82c-4fe5-b592-9152b32b59fc
Spec:
Dependencies:
jitpack:com.github.hadoken79/jitPackCamelTest/v1.1
Sources:
Content: // camel-k: dependency=jitpack:com.github.hadoken79/jitPackCamelTest/v1.1
import ch.tralala.testProcessor;
import org.apache.camel.builder.RouteBuilder;
/**
* A Camel Java DSL Router
*/
public class Test extends RouteBuilder {
/**
* Let's configure the Camel routing rules using Java code...
*/
public void configure() {
//getContext().setTracing(true);
from("timer://foo?fixedRate=true&period=10000")
.setProperty("key", constant("val"))
.setHeader("key", constant("val"))
.setBody(constant("foo"))
.process(new testProcessor());
}
}
Name: Test.java
Status:
Conditions:
First Truthy Time: 2021-08-28T07:52:13Z
Last Transition Time: 2021-08-28T07:52:13Z
Last Update Time: 2021-08-28T07:52:13Z
Message: camel-k
Reason: IntegrationPlatformAvailable
Status: True
Type: IntegrationPlatformAvailable
Last Transition Time: 2021-08-28T07:52:13Z
Last Update Time: 2021-08-28T07:52:13Z
Message: creating a new integration kit
Reason: IntegrationKitAvailable
Status: False
Type: IntegrationKitAvailable
Dependencies:
camel-quarkus:timer
jitpack:com.github.hadoken79/jitPackCamelTest/v1.1
mvn:org.apache.camel.k/camel-k-loader-java
mvn:org.apache.camel.k/camel-k-runtime
Digest: vtgnAVk8BH8fmI5xvYHAVh-pS6fau6ggrJluJqoDSP5o
Kit: kit-c4kum0bj3qfqnm9cbrl0
Last Init Timestamp: 2021-08-28T07:52:13Z
Phase: Error
Platform: camel-k
Profile: Kubernetes
Runtime Provider: quarkus
Runtime Version: 1.6.0
Version: 1.3.1
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal IntegrationConditionChanged 4m58s camel-k-integration-controller Condition "IntegrationPlatformAvailable" is "True" for Integration test: camel-k
Normal IntegrationPhaseUpdated 4m58s camel-k-integration-controller Integration test in phase "Initialization"
Normal IntegrationConditionChanged 4m58s camel-k-integration-controller Condition "IntegrationKitAvailable" is "False" for Integration test: creating a new integration kit
Normal IntegrationPhaseUpdated 4m58s camel-k-integration-controller Integration test in phase "Building Kit"
Normal ReasonRelatedObjectChanged 4m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Initialization" (recovery 4 of 5)
Normal ReasonRelatedObjectChanged 4m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Scheduling" (recovery 4 of 5)
Normal ReasonRelatedObjectChanged 4m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Pending" (recovery 4 of 5)
Normal ReasonRelatedObjectChanged 4m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Running" (recovery 4 of 5)
Normal ReasonRelatedObjectChanged 4m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Failed" (recovery 4 of 5)
Normal ReasonRelatedObjectChanged 3m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Initialization" (recovery 5 of 5)
Normal ReasonRelatedObjectChanged 3m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Scheduling" (recovery 5 of 5)
Normal ReasonRelatedObjectChanged 3m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Pending" (recovery 5 of 5)
Normal ReasonRelatedObjectChanged 3m21s camel-k-build-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Running" (recovery 5 of 5)
Normal ReasonRelatedObjectChanged 3m21s (x2 over 3m21s) camel-k-build-controller (combined from similar events): Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Error" (recovery 5 of 5)
Normal ReasonRelatedObjectChanged 3m21s (x2 over 3m21s) camel-k-build-controller (combined from similar events): Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Build) changed phase to "Error" (recovery 5 of 5)
Normal ReasonRelatedObjectChanged 3m21s camel-k-integration-kit-controller Integration test subresource kit-c4kum0bj3qfqnm9cbrl0 (Integration Kit) changed phase to "Error"
Normal IntegrationPhaseUpdated 3m21s camel-k-integration-controller Integration test in phase "Error" on jitpack jar is available, also in a local mvn project route works in camel In kamel-operator logs: {"level":"info","ts":1630139324.0974753,"logger":"camel-k.builder","msg":"step failed with error: unknown dependency type: jitpack:com.github.hadoken79/jitPackCamelTest/v1.1","step":"github.com/apache/camel-k/pkg/builder/InjectDependencies","phase":12,"name":"kit-c4kv763j3qfqnm9cbrm0","task":"builder"}
kubectl describe configmap camel-k-maven-settings Name: camel-k-maven-settings
Namespace: default
Labels: app=camel-k
Annotations: <none>
Data
====
settings.xml:
----
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository></localRepository>
<profiles>
<profile>
<id>maven-settings</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
Events: <none>
|
Update:
Then there is no need to add the jitpack repo in maven-settings configmap or xml. It then just works out of the box. |
Thanks to your example @hadoken79 I was able to pinpoint the issue. External dependencies in jitpack don't work when a dash The error message when using the modeline
I cloned |
So I can currently pinpoint two problems:
|
Regarding documentation, contributions are always welcomed. Good points to enhance would be: |
So I tried to debug this yesterday, without any success so far. It beats me as to why. I think I'll close the issue if nobody has any idea. I made the following tests in the codebase:
But these worked fine. |
you can try to grab the generated pom and run it locally so you can troubleshoot it. |
I've create a simple project like: <?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.acme</groupId>
<artifactId>getting-started</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.github.mmacphail</groupId>
<artifactId>temp-schemas</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
</project> then when building it fails with:
So it looks like a set-up error in the project or a glitch in jitpack |
Thank you for your investigation! This glitch is interresting. |
Versions
kubernetes: docker for dekstop 1.19
camelk client :
Camel K Client 1.5.0
Given the following kamel installation:
And the following helloworld.groovy file:
Running the integration using jitpack dependency fails using this
kamel run
command:This fails although
https://jitpack.io/#mmacphail/temp-schemas/1.0
exists.The failure happens during the building kit phase.
A describe such as
kubectl describe integration helloworld
shows the following information:Logs of the camel-k-operator pod show the following:
I don't understand why this dependency is not found since it's the jitpack repository is correctly added to the settings.xml. The command
kubectl describe configmap camel-k-maven-settings
returns the following:The text was updated successfully, but these errors were encountered: