Skip to content
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

Error: Missing relative path in pom file preventing parent download #261

Closed
gounthar opened this issue Sep 12, 2024 · 7 comments
Closed
Labels
bug For changelog: Minor bug. Will be listed after features

Comments

@gounthar
Copy link
Collaborator

Jenkins and plugins versions report

java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar --dry-run --plugins badge,build-timestamp --recipes AddPluginsBom,AddCodeOwner --export-datatables
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -XX:ActiveProcessorCount=1
Starting Plugin Modernizer 
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -XX:ActiveProcessorCount=1
Skipping forking plugin badge in dry-run mode 
Skipping sync plugin badge in dry-run mode 
Fetching plugin code locally badge... 
Thread[JGit-FileStoreAttributeReader-1,5,main]: got smaller file timestamp on / (/.workspace/mark), /home/gitpod/.cache/jenkins-plugin-modernizer-cli/badge/sources/.git: 2024-09-12T15:00:39Z < 2024-09-12T15:00:39.795861241Z. Aborting measurement at resolution PT0.204138759S. 
Missing relative path in pom file preventing parent download 
Skipping plugin badge due to metadata/precondition errors. Check logs for more details. 
Skipping forking plugin build-timestamp in dry-run mode 
Skipping sync plugin build-timestamp in dry-run mode 
Fetching plugin code locally build-timestamp... 
Missing relative path in pom file preventing parent download 
Skipping plugin build-timestamp due to metadata/precondition errors. Check logs for more details. 
************* 
Plugin: badge 
Error: Missing relative path in pom file preventing parent download 
************* 
************* 
Plugin: build-timestamp 
Error: Missing relative path in pom file preventing parent download 
************* 
Plugin Modernizer finished. 

What Operating System are you using (both controller, and any agents involved in the problem)?

GitPod

Reproduction steps

java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar --dry-run --plugins badge,build-timestamp --recipes AddPluginsBom,AddCodeOwner --export-datatables
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -XX:ActiveProcessorCount=1
Starting Plugin Modernizer 
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -XX:ActiveProcessorCount=1
Skipping forking plugin badge in dry-run mode 
Skipping sync plugin badge in dry-run mode 
Fetching plugin code locally badge... 
Thread[JGit-FileStoreAttributeReader-1,5,main]: got smaller file timestamp on / (/.workspace/mark), /home/gitpod/.cache/jenkins-plugin-modernizer-cli/badge/sources/.git: 2024-09-12T15:00:39Z < 2024-09-12T15:00:39.795861241Z. Aborting measurement at resolution PT0.204138759S. 
Missing relative path in pom file preventing parent download 
Skipping plugin badge due to metadata/precondition errors. Check logs for more details. 
Skipping forking plugin build-timestamp in dry-run mode 
Skipping sync plugin build-timestamp in dry-run mode 
Fetching plugin code locally build-timestamp... 
Missing relative path in pom file preventing parent download 
Skipping plugin build-timestamp due to metadata/precondition errors. Check logs for more details. 
************* 
Plugin: badge 
Error: Missing relative path in pom file preventing parent download 
************* 
************* 
Plugin: build-timestamp 
Error: Missing relative path in pom file preventing parent download 
************* 
Plugin Modernizer finished. 

Expected Results

logs

Actual Results

error

Anything else?

No response

Are you interested in contributing a fix?

No response

@gounthar gounthar added the bug For changelog: Minor bug. Will be listed after features label Sep 12, 2024
@jonesbusy
Copy link
Collaborator

More a missing feature than a bug

Error: Missing relative path in pom file preventing parent download 

Looks correct according to https://github.com/jenkinsci/badge-plugin/blob/master/pom.xml#L7

I think it work if by chanche you have already the parent pom on your local cache. Which is probably not the case on gitpod

Solution would be to statically extract the parent version and install it via maven invoker

mvn dependency:get -Dartifact=org.jenkins-ci.plugins:plugin:4.87:pom -DremoteRepositories=https://repo.jenkins-ci.org/public/ -Dtransitive=false

Then we can apply the recipe to include the relative path

@gounthar
Copy link
Collaborator Author

Thanks, I will have a look.👍

@gounthar
Copy link
Collaborator Author

The proposed workaround does not work for me. 🤷

Fetching plugin code locally build-timestamp... 
Missing relative path in pom file preventing parent download 
Skipping plugin build-timestamp due to metadata/precondition errors. Check logs for more details. 
************* 
Plugin: badge 
Error: Missing relative path in pom file preventing parent download 
************* 
************* 
Plugin: build-timestamp 
Error: Missing relative path in pom file preventing parent download 
************* 
Plugin Modernizer finished. 

@gounthar
Copy link
Collaborator Author

gounthar commented Oct 4, 2024

It's still the case today. 🤔

@gounthar gounthar changed the title Proposed command fails Error: Missing relative path in pom file preventing parent download Oct 4, 2024
@jonesbusy
Copy link
Collaborator

Closing. Feel free to reopen we see other occurence but I don't think since the plugin code is moved to the cache

@gounthar
Copy link
Collaborator Author

gounthar commented Jan 2, 2025

Those two plugins still fail with today's code, but as I don't have logs, I can't say if it is related or not with relativePath missing:

java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar dry-run --plugins badge,build-timestamp --recipe AddPluginsBom
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -XX:ActiveProcessorCount=1
Run Plugin Modernizer in dry-run mode 
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -XX:ActiveProcessorCount=1
Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -XX:ActiveProcessorCount=1
Skipping forking plugin badge in dry-run mode 
Skipping sync plugin badge in dry-run mode 
Fetching plugin code locally badge... 
Thread[Thread-9,5,main]: got smaller file timestamp on / (/.workspace/mark), /home/gitpod/.cache/jenkins-plugin-modernizer-cli/badge/sources/.git: 2025-01-02T10:39:25Z < 2025-01-02T10:39:25.424512237Z. Aborting measurement at resolution PT0.575487763S. 
Collecting metadata for plugin badge... Please be patient 
Build failed 
Done 
Failed to collect metadata for plugin badge. Will retry after a first compile using lowest JDK 
Verifying plugin without tests badge using with JDK 8 ... Please be patient 
Build failed 
Skipping forking plugin build-timestamp in dry-run mode 
Skipping sync plugin build-timestamp in dry-run mode 
Fetching plugin code locally build-timestamp... 
Collecting metadata for plugin build-timestamp... Please be patient 
Build failed 
Done 
Failed to collect metadata for plugin build-timestamp. Will retry after a first compile using lowest JDK 
Verifying plugin without tests build-timestamp using with JDK 8 ... Please be patient 
Build failed 
************* 
Plugin: badge 
Error: Build failed 
************* 
************* 
Plugin: build-timestamp 
Error: Build failed 
************* 

@jonesbusy
Copy link
Collaborator

Related to gitpod setup ? I never take a look at this to be honnest

I just run the same on my machine and no issue

No issue also for tests (some remove the relativePath and ensure it's added)

Also running the UpgradeToRecommendCoreVersion open the following PR

https://github.com/jenkinsci/build-timestamp-plugin/pull/84/files

Without build logs on logs/.log it's difficult to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features
Projects
None yet
Development

No branches or pull requests

2 participants