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

tailwindcss webjar version conflict #1922

Open
ksclarke opened this issue Mar 22, 2021 · 5 comments
Open

tailwindcss webjar version conflict #1922

ksclarke opened this issue Mar 22, 2021 · 5 comments

Comments

@ksclarke
Copy link

There seems to be a version issue with the tailwindcss webjar. Seeing there was already an NPM tailwindcss webjar, I used the form to submit the latest version: 2.0.4. The process worked and a Maven webjar was created, but when I try to use it in a project I get the following version conflict between its dependencies:

Could not resolve version conflict among [org.webjars.npm:tailwindcss:jar:2.0.4 -> org.webjars.npm:reduce-css-calc:jar:[2.1.8,3) -> org.webjars.npm:postcss-value-parser:jar:[3.3.0,4), org.webjars.npm:tailwindcss:jar:2.0.4 -> org.webjars.npm:postcss-value-parser:jar:[4.1.0,5), org.webjars.npm:tailwindcss:jar:2.0.4 -> org.webjars.npm:postcss-functions:jar:[3.0.0,4) -> org.webjars.npm:postcss-value-parser:jar:[3.3.0,4)]

The Maven build fails as a result.

@jamesward
Copy link
Member

Oh the joy of version ranges. NPM WebJars convert the NPM dependency definitions to Maven dependencies. And in this case it looks like the ranges are incompatible in how Maven deals with them. Your best bet is to override the transitive dependencies with explicit ones so that Maven doesn't try to resolve the graph. Doing that depends on which build tool you are using.

@ksclarke
Copy link
Author

ksclarke commented Mar 22, 2021

So I think I'll go a different way with tailwindcss, but just to follow up on the suggestion above (in case someone else comes along with this same issue), this Maven config does produce a successful build:

    <dependency>
      <groupId>org.webjars.npm</groupId>
      <artifactId>tailwindcss</artifactId>
      <version>2.0.4</version>
    </dependency>
    <dependency>
      <groupId>org.webjars.npm</groupId>
      <artifactId>postcss-functions</artifactId>
      <version>3.0.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.webjars.npm</groupId>
          <artifactId>postcss-value-parser</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.webjars.npm</groupId>
          <artifactId>postcss</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.webjars.npm</groupId>
      <artifactId>reduce-css-calc</artifactId>
      <version>2.1.8</version>
      <exclusions>
        <exclusion>
          <groupId>org.webjars.npm</groupId>
          <artifactId>postcss-value-parser</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.webjars.npm</groupId>
      <artifactId>postcss-js</artifactId>
      <version>3.0.3</version>
      <exclusions>
        <exclusion>
          <groupId>org.webjars.npm</groupId>
          <artifactId>postcss</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.webjars.npm</groupId>
      <artifactId>color</artifactId>
      <version>3.1.3</version>
      <exclusions>
        <exclusion>
          <groupId>org.webjars.npm</groupId>
          <artifactId>color-convert</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

It removes the lower version dependencies where there are conflicts.

@jamesward
Copy link
Member

Thanks for sharing!

@ehlui
Copy link

ehlui commented Jan 11, 2022

Thanks @ksclarke , so forcing transitive versions works but this way is too dirty I think, but does what I need too

@ksclarke
Copy link
Author

Yes, it's not ideal.

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

No branches or pull requests

3 participants