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

Provide a mechanism for overriding upstream poms #43

Open
jhickman opened this issue May 14, 2020 · 3 comments
Open

Provide a mechanism for overriding upstream poms #43

jhickman opened this issue May 14, 2020 · 3 comments
Milestone

Comments

@jhickman
Copy link
Member

As a developer writing an j2cl application, I want to be able to modify upstream maven module poms such that I have ability to add/remove dependencies as necessary to make it j2cl compatible.
Unlike with the <dependencyReplacements>, I don't want to replace the jar contents. Just the pom itself.

As an example, let's look at dagger2. Dagger2 contains a transitive dependency of javax.inject. As this is a dependency on the jar and not the sources, there are issues with j2cl compiling dagger2. I would like to be able to essentially rewrite the dagger2 pom to add the additional dependency to the javax.inject sources.

One possible solution to this would be to create an extra <configuration> section to swap poms. Then when the j2cl maven plugin needs to compile any module with a pom replacement, it'll use that pom for gathering dependencies instead; and possible replacing the <groupId> and <artifactId>'s as necessary.

<configuration>
  <pomOverrides>
    <original>com.google.dagger:dagger:2.15</original>
    <replacement>com.vertispan.gwt.dagger:dagger:2.15</replacement>
  </pomOverrides>
</configuration>
@niloc132
Copy link
Member

niloc132 commented Jun 2, 2020

Could be used to fix elemental2-webassembly, since it was shipped with an incorrect pom google/elemental2#142

@niloc132
Copy link
Member

Quick thought on this: chances are any replacement pom will end up being published as packaging=pom, we'll need to verify that this doesn't affect trying to explain to maven that the updated dependency still has the old artifacts attached to it. It should probably be fine, since it is legal to attach an artifact to a packaging=pom project.

@niloc132
Copy link
Member

I have 80% of a test case finished for this, just having trouble because the plugin is a bit too clever about figuring out where your sources are for a reactor project. Will link a branch soon for discussion.

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

2 participants