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

Stop relying on javax.json 1.1.4 #57

Closed
Reza-1 opened this issue Oct 4, 2023 · 5 comments · Fixed by #58
Closed

Stop relying on javax.json 1.1.4 #57

Reza-1 opened this issue Oct 4, 2023 · 5 comments · Fixed by #58
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Milestone

Comments

@Reza-1
Copy link

Reza-1 commented Oct 4, 2023

Describe the bug (required)

I got a a build error saying

[ERROR] Failed to execute goal io.github.git-commit-id:git-commit-id-maven-plugin:5.0.0:revision
....
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact jakarta.json:jakarta.json-api:jar:1.1.4

I cloned your repo to check the dependencies (i.e. running mvn dependency ) and I noticed there is a reference to
+- javax.json:javax.json-api:jar:1.1.4:compile
not sure why build tried to look for jakarta.json 1.1.4 but in any case, javax... is now replaced with jakarta...

Could you please update your package dependency to jakarta.json-api instead .
seems the earliest version of jakarta.json-api is 1.1.5
https://mvnrepository.com/artifact/jakarta.json/jakarta.json-api

Tell us about your plugin configuration (required)

            <plugin>
                <groupId>io.github.git-commit-id</groupId>
                <artifactId>git-commit-id-maven-plugin</artifactId>
                <version>5.0.0</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                        <phase>initialize</phase>
                    </execution>
                </executions>
                <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <generateGitPropertiesFilename>${project.build.outputDirectory}/git.info</generateGitPropertiesFilename>
                    <includeOnlyProperties>
                        <includeOnlyProperty>^git.branch$</includeOnlyProperty>
                        <includeOnlyProperty>^git.commit.time$</includeOnlyProperty>
                        <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
                        <includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
                        <includeOnlyProperty>^git.local.branch.(ahead|behind)$</includeOnlyProperty>
                    </includeOnlyProperties>
                    <commitIdGenerationMode>full</commitIdGenerationMode>
                </configuration>
            </plugin>

Tell us about the Plugin version used (required)

5

Tell us about the Maven version used (required)

mvn --version
// Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Steps to Reproduce (required)

I run the plugin with mvn clean deploy VS mvn deploy:deploy...

Are there any stacktraces or any error messages? (required)

WARNING You may NOT want to paste all the output that is produced with verbose publicly,
since it MAY contain information you deem sensitive.
Review this CAREFULLY before posting your issue!

mvn clean deploy
// ????

Is there a (public) project where this issue can be reproduced? (optional)

No response

Your Environment (optional)

No response

Context (optional)

No response

@Reza-1 Reza-1 added bug Something isn't working to-triage labels Oct 4, 2023
@TheSnoozer
Copy link
Contributor

Are you sure this is caused by the plugin?
I can't see that dependency:

$ git checkout v5.0.0
$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------< io.github.git-commit-id:git-commit-id-maven-plugin >---------
[INFO] Building Git Commit Id Maven Plugin 5.0.0
[INFO] ----------------------------[ maven-plugin ]----------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ git-commit-id-maven-plugin ---
[INFO] io.github.git-commit-id:git-commit-id-maven-plugin:maven-plugin:5.0.0
[INFO] +- org.apache.maven:maven-plugin-api:jar:3.1.0-alpha-1:compile
[INFO] |  +- org.apache.maven:maven-model:jar:3.1.0-alpha-1:compile
[INFO] |  +- org.apache.maven:maven-artifact:jar:3.1.0-alpha-1:compile
[INFO] |  \- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M2a:compile
[INFO] |     +- javax.enterprise:cdi-api:jar:1.0:compile
[INFO] |     |  +- javax.annotation:jsr250-api:jar:1.0:compile
[INFO] |     |  \- javax.inject:javax.inject:jar:1:compile
[INFO] |     +- com.google.guava:guava:jar:10.0.1:compile
[INFO] |     +- org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[INFO] |     |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |     \- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M2a:compile
[INFO] |        \- asm:asm:jar:3.3.1:compile
[INFO] +- org.apache.maven:maven-core:jar:3.1.0-alpha-1:compile
[INFO] |  +- org.apache.maven:maven-settings:jar:3.1.0-alpha-1:compile
[INFO] |  +- org.apache.maven:maven-settings-builder:jar:3.1.0-alpha-1:compile
[INFO] |  +- org.apache.maven:maven-repository-metadata:jar:3.1.0-alpha-1:compile
[INFO] |  +- org.apache.maven:maven-model-builder:jar:3.1.0-alpha-1:compile
[INFO] |  +- org.apache.maven:maven-aether-provider:jar:3.1.0-alpha-1:compile
[INFO] |  |  \- org.eclipse.aether:aether-spi:jar:0.9.0.M2:compile
[INFO] |  +- org.eclipse.aether:aether-impl:jar:0.9.0.M2:compile
[INFO] |  +- org.eclipse.aether:aether-api:jar:0.9.0.M2:compile
[INFO] |  +- org.eclipse.aether:aether-util:jar:0.9.0.M2:compile
[INFO] |  +- org.codehaus.plexus:plexus-interpolation:jar:1.16:compile
[INFO] |  +- org.codehaus.plexus:plexus-utils:jar:3.0.10:compile
[INFO] |  +- org.codehaus.plexus:plexus-classworlds:jar:2.4.2:compile
[INFO] |  +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[INFO] |  \- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[INFO] |     \- org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[INFO] +- io.github.git-commit-id:git-commit-id-plugin-core:jar:5.0.0:compile
[INFO] |  +- org.eclipse.jgit:org.eclipse.jgit:jar:5.12.0.202106070339-r:compile
[INFO] |  |  \- com.googlecode.javaewah:JavaEWAH:jar:1.1.7:compile
[INFO] |  +- org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:jar:5.12.0.202106070339-r:compile
[INFO] |  |  +- com.jcraft:jsch:jar:0.1.55:compile
[INFO] |  |  \- com.jcraft:jzlib:jar:1.1.1:compile
[INFO] |  +- joda-time:joda-time:jar:2.10.10:compile
[INFO] |  +- org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile
[INFO] |  +- nu.studer:java-ordered-properties:jar:1.0.4:compile
[INFO] |  +- javax.json:javax.json-api:jar:1.1.4:compile
[INFO] |  \- org.glassfish:javax.json:jar:1.1.4:compile
[INFO] +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] +- org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.6.0:provided
[INFO] +- junit:junit:jar:4.13.2:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.assertj:assertj-core:jar:3.19.0:test
[INFO] +- org.mockito:mockito-core:jar:3.11.0:test
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.11.1:test
[INFO] |  +- net.bytebuddy:byte-buddy-agent:jar:1.11.1:test
[INFO] |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] +- commons-io:commons-io:jar:2.9.0:test
[INFO] +- pl.pragmatists:JUnitParams:jar:1.1.1:test
[INFO] +- com.github.stefanbirkner:system-rules:jar:1.19.0:test
[INFO] \- org.slf4j:slf4j-simple:jar:1.7.25:test
[INFO]    \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.393 s
[INFO] Finished at: 2023-10-06T22:17:13+02:00
[INFO] ------------------------------------------------------------------------

@TheSnoozer
Copy link
Contributor

TheSnoozer commented Oct 6, 2023

As a side note the plugin relied on jackson-databind but that was replaced a long time ago....see https://github.com/git-commit-id/git-commit-id-maven-plugin/releases/tag/v4.0.3 . So even an old version was at last that I can remember not relying on any jakarta.json.

@TheSnoozer TheSnoozer changed the title maven dependency Stop relying on jakarta.json Oct 6, 2023
@TheSnoozer TheSnoozer changed the title Stop relying on jakarta.json Stop relying on jakarta.json 1.1.4 Oct 6, 2023
@Reza-1
Copy link
Author

Reza-1 commented Oct 7, 2023

I corrected the title,
but in the description I put the correct name:
+- javax.json:javax.json-api:jar:1.1.4:compile
And it shows up in your dependency tree too.
if possible please upgrade to use jakarta.json-api is 1.1.5 or higher (since javax package has been renamed to jakarta )

@Reza-1 Reza-1 changed the title Stop relying on jakarta.json 1.1.4 Stop relying on javax.json 1.1.4 Oct 7, 2023
@TheSnoozer
Copy link
Contributor

Ok, I'm still confused by your error message that mentions Could not find artifact jakarta.json:jakarta.json-api:jar:1.1.4 since this is still not a dependency of this project.

The javax.json:javax.json-api the plugin is using still exists:
https://mvnrepository.com/artifact/javax.json/javax.json-api/1.1.4

Anyhow I agree that as https://mvnrepository.com/artifact/javax.json/javax.json-api mentions that it was relocated to jakarta.json » jakarta.json-api so what remains here is indeed to use https://mvnrepository.com/artifact/jakarta.json/jakarta.json-api/2.1.2 instead.

@TheSnoozer TheSnoozer transferred this issue from git-commit-id/git-commit-id-maven-plugin Oct 8, 2023
@TheSnoozer TheSnoozer added enhancement New feature or request dependencies Pull requests that update a dependency file and removed bug Something isn't working to-triage labels Oct 8, 2023
TheSnoozer pushed a commit that referenced this issue Oct 8, 2023
- The dependency javax.json:javax.json-api was relocated to jakarta.json:jakarta.json-api (implicit bump from version 1.1.4 to 2.1.2)
- The dependency org.glassfish:javax.json was relocated to org.glassfish:jakarta.json (implicit bump from version 1.1.4 to 2.0.1)
@Reza-1
Copy link
Author

Reza-1 commented Oct 8, 2023

the issue was confusing to begin with because I saw this line in our build system log
Execution get-the-git-infos of goal io.github.git-commit-id:git-commit-id-maven-plugin:5.0.0:revision failed: Plugin io.github.git-commit-id:git-commit-id-maven-plugin:5.0.0 or one of its dependencies could not be resolved: Could not find artifact jakarta.json:jakarta.json-api:jar:1.1.4 in

which ended up failing because jakarta.json earliest version is 1.1.5 ( I think as a result of some maven relocation configuration https://maven.apache.org/guides/mini/guide-relocation.html somewhere in our repository)
but in your plugin dependency tree it is javax.json.1.1.4 which is technically still valid

anyway ,thanks that you are moving the dependency to newer version. Hope that solves the error message in the build

TheSnoozer pushed a commit that referenced this issue Oct 8, 2023
Aparently we now need to stop relying on
```
            <groupId>org.glassfish</groupId>
            <artifactId>jakarta.json</artifactId>
            <version>2.0.1</version>
```
and instead use
```
            <groupId>org.eclipse.parsson</groupId>
            <artifactId>parsson</artifactId>
            <version>1.1.4</version>
```

See https://github.com/elastic/elasticsearch-java/pull / 63
and https://jakarta.ee/blogs/javax-jakartaee-namespace-ecosystem-progress/
TheSnoozer added a commit that referenced this issue Oct 8, 2023
#57: Use relocated json dependencies
@TheSnoozer TheSnoozer added this to the 6.0.0-rc.6 milestone Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants