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

Make pom.xml depend on the JVM artifact #7354

Merged
merged 1 commit into from Jun 27, 2022

Conversation

swankjesse
Copy link
Member

This should prevent Maven users from needing to change
their dependencies from okhttp to okhttp-jvm. More importantly,
it should also prevent them from inadvertently getting two
different OkHttp JVM artifacts on their classpaths at once.

This should prevent Maven users from needing to change
their dependencies from okhttp to okhttp-jvm. More importantly,
it should also prevent them from inadvertently getting two
different OkHttp JVM artifacts on their classpaths at once.
appendNode("groupId", jvmPublication.groupId)
appendNode("artifactId", jvmPublication.artifactId)
appendNode("version", jvmPublication.version)
appendNode("scope", "compile")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think I want this line. Shouldn’t the scope be compile + runtime?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking compileOnly, not compile. This is fine.

@swankjesse
Copy link
Member Author

We end up with this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.squareup.okhttp3</groupId>
  <artifactId>okhttp</artifactId>
  <version>5.0.0-SNAPSHOT</version>
  <name>okhttp</name>
  <description>Square’s meticulous HTTP client for Java and Kotlin.</description>
  <url>https://square.github.io/okhttp/</url>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Square, Inc.</name>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:https://github.com/square/okhttp.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/square/okhttp.git</developerConnection>
    <url>https://github.com/square/okhttp</url>
  </scm>
  <dependencies>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp-jvm</artifactId>
      <version>5.0.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants