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

Add property to configure dependencies prefixing #166

Closed
wants to merge 3 commits into from

Conversation

iaco86
Copy link
Contributor

@iaco86 iaco86 commented Apr 27, 2021

Relates to #159

  • added Property<Boolean> to turn on-off dependency prefixing for the project distribution. Default to on for backwards compatibility
  • added simple test to validate prefixing happens for a well known library (com.typesafe.play)
  • updated documentation

@iaco86
Copy link
Contributor Author

iaco86 commented Apr 27, 2021

It looks like some dependencies hosted on repo.typesafe.com are not available anymore, even through redirects, as some shutdowns are happening across bintray and lightbend.

I'm trying to connect the dots and possibly find the new repository to use.

I can reproduce the failures locally - somehow I thought they were caused by local connectivity issues.

@iaco86
Copy link
Contributor Author

iaco86 commented Apr 27, 2021

Some discussions here and here.

This can be fixed to unblock the tests by adding the old, soon-to-be-deprecated, often browned-out bintray repo to org.gradle.playframework.fixtures.Repositories#playRepositories, at least until a full migration happens.

I can push this change to make sure all tests pass correctly - let me know what you want to do moving forward.

@JLLeitschuh
Copy link
Contributor

Can you describe more explicitly what this used to generate for coordinates and what it will generate now? Also, can you clarify why this change is needed?

@iaco86
Copy link
Contributor Author

iaco86 commented Apr 27, 2021

Forgot to link - this is regarding #159 , and it's especially visibile when another plugin modifying the default distribution for the project is used.

Our usecase is described in more detail here.

The fact that this plugin prefixes all dependencies causes all the jars to be duplicated in our case - we worked around this with a task to remove duplications based on regexes, but this seems a better way to achieve the same since as reported on this comment

This was something inherited from the old plugin. I think we started doing this because we had a user that had jars coming from subprojects with the same name as external dependencies (or maybe other subprojects). The identically named files would stomp on one another.

As an example, the plugin by default will stage the following files, given a sub-module called subproject:

ls -al /var/folders/7q/2n329c051hjc20fsfh9w224c0000gp/T/junit5908225871819091209/build/stage/main/lib
-rw-r--r--   1 staff  staff      4467 Apr 27 15:00 aopalliance-aopalliance-1.0.jar
-rw-r--r--   1 staff  staff    290339 Apr 27 15:00 ch.qos.logback-logback-classic-1.2.3.jar
-rw-r--r--   1 staff  staff    471901 Apr 27 15:00 ch.qos.logback-logback-core-1.2.3.jar
-rw-r--r--   1 staff  staff     55786 Apr 27 15:00 com.fasterxml.jackson.core-jackson-annotations-2.8.11.jar
-rw-r--r--   1 staff  staff    282633 Apr 27 15:00 com.fasterxml.jackson.core-jackson-core-2.8.11.jar
-rw-r--r--   1 staff  staff   1243475 Apr 27 15:00 com.fasterxml.jackson.core-jackson-databind-2.8.11.4.jar
-rw-r--r--   1 staff  staff     33846 Apr 27 15:00 com.fasterxml.jackson.datatype-jackson-datatype-jdk8-2.8.11.jar
-rw-r--r--   1 staff  staff     90059 Apr 27 15:00 com.fasterxml.jackson.datatype-jackson-datatype-jsr310-2.8.11.jar
-rw-r--r--   1 staff  staff     10265 Apr 27 15:00 subproject-subproject.jar
-rw-r--r--   1 staff  staff       265 Apr 27 15:00 subproject-subproject-assets.jar
...

by skipping renaming of the dependencies, the stage will be

ls -al /var/folders/7q/2n329c051hjc20fsfh9w224c0000gp/T/junit7702495924154060227/build/stage/main/lib
-rw-r--r--   1 staff  staff      4467 Apr 27 15:03 aopalliance-1.0.jar
-rw-r--r--   1 staff  staff    290339 Apr 27 15:03 logback-classic-1.2.3.jar
-rw-r--r--   1 staff  staff    471901 Apr 27 15:03 logback-core-1.2.3.jar
-rw-r--r--   1 staff  staff     55786 Apr 27 15:03 jackson-annotations-2.8.11.jar
-rw-r--r--   1 staff  staff    282633 Apr 27 15:03 jackson-core-2.8.11.jar
-rw-r--r--   1 staff  staff   1243475 Apr 27 15:03 jackson-databind-2.8.11.4.jar
-rw-r--r--   1 staff  staff     33846 Apr 27 15:03 jackson-datatype-jdk8-2.8.11.jar
-rw-r--r--   1 staff  staff     90059 Apr 27 15:03 jackson-datatype-jsr310-2.8.11.jar
-rw-r--r--   1 staff  staff     10265 Apr 27 15:03 subproject.jar
-rw-r--r--   1 staff  staff       265 Apr 27 15:03 subproject-assets.jar
...

Which will prevent any duplication from happening, but will still allow users who need renaming for the usecase described above, to do what they need.

@iaco86
Copy link
Contributor Author

iaco86 commented Apr 29, 2021

The bug with inaccessible repositories has been fixed by typesafe, so I removed the bintray repo added for testing.

@big-guy
Copy link
Member

big-guy commented Jun 10, 2021

I replied in #159 (comment) about why I think this change isn't enough. Thank you for your contributions.

@big-guy big-guy closed this Jun 10, 2021
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.

3 participants