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

chore: add java-shared-config as parent #1897

Closed
wants to merge 12 commits into from

Conversation

mpeddada1
Copy link
Contributor

@mpeddada1 mpeddada1 commented Nov 9, 2023

In addition reformatting the pre-existing copyright header to match the style in the added java.header file, copyright headers were added to existing java files with the years they were first published:

  • com.google.api.client.http.HttpMethods -> 2012
  • com.google.api.client.http.javanet.ConnectionFactory -> 2015
  • com.google.api.client.http.javanet.DefaultConnectionFactory -> 2015
  • com.google.api.client.http.apache.HttpExtensionMethod -> 2011
  • com.google.api.client.http.GzipSupport -> 2022

@mpeddada1 mpeddada1 requested a review from a team as a code owner November 9, 2023 20:09
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Nov 9, 2023
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Nov 10, 2023
@mpeddada1
Copy link
Contributor Author

mpeddada1 commented Nov 10, 2023

Calling mvn clean install -DskipTests locally with 97cceba results in a successful build but the CI checks are still failing with:

Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.3.1:check (checkstyle) on project google-http-client-parent: Failed during checkstyle execution: Unable to find configuration file at location: license-checks.xml: Could not find resource 'license-checks.xml'.

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Nov 13, 2023
@mpeddada1
Copy link
Contributor Author

Now running into:

Error:  Manifest com.google.http-client:google-http-client:jar:1.43.4-SNAPSHOT : ${version}, is not understood. too few arguments, for cmd: version, arguments; [version]
Error:  Error(s) found in manifest configuration

@burkedavison
Copy link
Member

Quickly replicated locally. Issue only seems to appear when working with an unclean target directory.
Ex:

mvn install -DskipTests -Dclirr.skip -Denforcer.skip -T 1C // Works
mvn test -Dclirr.skip -Denforcer.skip -T 1C // Fails
mvn clean test -Dclirr.skip -Denforcer.skip -T 1C // Works

@mpeddada1
Copy link
Contributor Author

mpeddada1 commented Nov 13, 2023

Thanks so much for testing it out! That's a great observation. Also able to replicate the same behavior with mvn test locally. Curious why it didn't occur previously.

Copy link

Warning: This pull request is touching the following templated files:

  • .kokoro/build.sh

@mpeddada1
Copy link
Contributor Author

mpeddada1 commented Nov 13, 2023

Removing java-shared-config as the parent results in successful build with mvn test but adding the following settings (defined in shared-config) to the parent pom's pluginManagement block results in the observations documented in #1897 (comment)

 <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <archive>
            <addMavenDescriptor>true</addMavenDescriptor>
            <index>true</index>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
              <artifactId>${project.artifactId}</artifactId>
              <groupId>${project.groupId}</groupId>
              <version>${project.version}</version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

UPDATE: Prioritizing the setting in the child pom (i.e this repo) brings back original behavior.

@mpeddada1
Copy link
Contributor Author

mpeddada1 commented Nov 14, 2023

The ci-java7 check is failing with java.lang.UnsupportedClassVersionError. The stacktrace of a successful build shows that this part is missing from the current build:

[INFO] --- maven-compiler-plugin:3.11.0:compile (default-compile) @ google-http-client ---
[INFO] Changes detected - recompiling the module! :dependency
[INFO] Compiling 157 source files with javac [debug target 1.7] to target/classes
Warning:  bootstrap class path not set in conjunction with -source 7
Warning:  source value 7 is obsolete and will be removed in a future release
Warning:  target value 7 is obsolete and will be removed in a future release

The code isn't being compiled with jdk 7. From current stacktrace:

[INFO] --- maven-compiler-plugin:3.11.0:compile (default-compile) @ google-http-client ---
[INFO] Changes detected - recompiling the module! :dependency
[INFO] Compiling 157 source files with javac [debug release 8] to target/classes

@mpeddada1
Copy link
Contributor Author

Running mvn clean install -DskipTests locally with mvn 3.6.3 and java 1.7.0_252 locally results in:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/fasterxml/jackson/databind/ObjectMapper : Unsupported major.minor version 52.0

mvn -X -V shows:

[DEBUG] org.sonatype.plugins:nexus-staging-maven-plugin:jar:1.6.13
[DEBUG]    org.sonatype.nexus.maven:nexus-common:jar:1.6.13:compile
[DEBUG]       org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:compile (version managed from default) (exclusions managed from default)
[DEBUG]          org.sonatype.plexus:plexus-cipher:jar:1.7:compile (version managed from default)
[DEBUG]    com.google.guava:guava:jar:14.0.1:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:3.0.4:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:3.0.4:compile
[DEBUG]       org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
[DEBUG]          org.codehaus.plexus:plexus-classworlds:jar:2.4:compile
[DEBUG]          org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
[DEBUG]             org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[DEBUG]    org.apache.maven:maven-model:jar:3.0.4:compile
[DEBUG]    org.apache.maven:maven-compat:jar:3.0.4:compile
[DEBUG]       org.apache.maven:maven-model-builder:jar:3.0.4:compile
[DEBUG]       org.apache.maven:maven-settings:jar:3.0.4:compile
[DEBUG]       org.apache.maven:maven-core:jar:3.0.4:compile (version managed from default)
[DEBUG]          org.apache.maven:maven-settings-builder:jar:3.0.4:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:3.0.4:compile
[DEBUG]          org.apache.maven:maven-aether-provider:jar:3.0.4:compile
[DEBUG]             org.sonatype.aether:aether-spi:jar:1.13.1:compile
[DEBUG]          org.sonatype.aether:aether-impl:jar:1.13.1:compile
[DEBUG]          org.sonatype.aether:aether-util:jar:1.13.1:compile
[DEBUG]       org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile (version managed from default)
[DEBUG]       org.apache.maven.wagon:wagon-provider-api:jar:2.2:compile
[DEBUG]    org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2:compile
[DEBUG]    org.sonatype.nexus:nexus-client-core:jar:2.15.1-02:compile (exclusions managed from default)
[DEBUG]       org.sonatype.nexus.plugins:nexus-restlet1x-model:jar:2.15.1-02:compile
[DEBUG]       org.slf4j:slf4j-api:jar:1.7.36:compile (version managed from default)
[DEBUG]       com.google.code.findbugs:jsr305:jar:2.0.1:compile
[DEBUG]       com.intellij:annotations:jar:9.0.4:compile (version managed from default)
[DEBUG]       commons-io:commons-io:jar:2.8.0:compile
[DEBUG]       com.thoughtworks.xstream:xstream:jar:1.4.19:compile (version managed from default)
[DEBUG]          io.github.x-stream:mxparser:jar:1.2.2:compile
[DEBUG]             xmlpull:xmlpull:jar:1.1.3.1:compile
[DEBUG]       joda-time:joda-time:jar:2.2:compile
[DEBUG]       commons-lang:commons-lang:jar:2.6:compile
[DEBUG]       commons-beanutils:commons-beanutils:jar:1.9.4:compile (version managed from default) (exclusions managed from default)
[DEBUG]          commons-collections:commons-collections:jar:3.2.2:compile
[DEBUG]       org.sonatype.sisu.siesta:siesta-client:jar:1.8:compile
[DEBUG]          org.sonatype.sisu.siesta:siesta-common:jar:1.8:compile
[DEBUG]             javax.ws.rs:jsr311-api:jar:1.1.1:compile
[DEBUG]             com.sun.jersey:jersey-core:jar:1.17.1:compile
[DEBUG]             javax.validation:validation-api:jar:1.1.0.Final:compile
[DEBUG]          com.sun.jersey:jersey-client:jar:1.17.1:compile
[DEBUG]          com.sun.jersey.contribs:jersey-apache-client4:jar:1.17.1:compile
[DEBUG]       org.sonatype.sisu.siesta:siesta-jackson:jar:1.8:compile
[DEBUG]          com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2:compile (version managed from default)
[DEBUG]          com.fasterxml.jackson.core:jackson-core:jar:2.13.2:compile (version managed from default)
[DEBUG]          com.fasterxml.jackson.core:jackson-databind:jar:2.13.2.2:compile (version managed from default)
[DEBUG]          com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.13.2:compile (version managed from default)
[DEBUG]             com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.13.2:compile
[DEBUG]          com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.13.2:compile (version managed from default)

@mpeddada1
Copy link
Contributor Author

Closing in favor of #1908

@mpeddada1 mpeddada1 closed this Dec 18, 2023
@mpeddada1 mpeddada1 deleted the shared-config-http-client branch December 18, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants