corda / corda-gradle-plugins

Gradle plugins used by Corda and Cordapps
Other
24 stars 36 forks source link

Cordaformation plugin does not copy CorDapps to fully-qualified JAR filenames #360

Closed nsmith00 closed 3 years ago

nsmith00 commented 3 years ago

Thank you for choosing to report an issue with Corda.

When reporting an issue please make sure it contains;

nsmith00 commented 3 years ago

The deployNodes task saves the dependent non-project CorDapps copied from the source repository to the node cordapps directories using only the artifact name and version (as is stored in the repository). This causes the plugin to overwrite CorDapps which have the same artifact name.

This issue occurs with corda-gradle-plugins version 5.0.13

chrisr3 commented 3 years ago

The deployNodes task saves the dependent non-project CorDapps copied from the source repository to the node cordapps directories using only the artifact name and version (as is stored in the repository). This causes the plugin to overwrite CorDapps which have the same artifact name.

Hi, thanks for your report. However, I don't think I understand the issue. The cordformation plugin is installing the CorDapp with the precise file name that it has in the remote repository - which includes both its artifact name and version. Are you trying also to install a different CorDapp which nonetheless has the exact same file name (including its artifact name and version number) as the remote CorDapp? In which case, it would seem that we could modify cordformation, but this wouldn't change the fundamental problem which is that you would still have two different CorDapps with the same file name.

This issue occurs with corda-gradle-plugins version 5.0.13

FYI 5.0.13 was released on Feb 15th 2021.

nsmith00 commented 3 years ago

Hi, I probably didn’t specify the issue too well, The problem occurs when installing multiple cordapps that have the same artifact name and version but different group names onto a node. As the plugin uses only the artifact name and version to create the name of the destination JAR, cordapps can be overwitten by other cordapps It can be argued that the plugin is using the precise artifact name of the file in the repository, but for us it is ignoring the qualifying group name (which in a maven repository is the name of the grandparent directory of the artifact).

Kind regards,

Nick

On 22 Mar 2021, at 21:20, Chris Rankin @.***> wrote:

The deployNodes task saves the dependent non-project CorDapps copied from the source repository to the node cordapps directories using only the artifact name and version (as is stored in the repository). This causes the plugin to overwrite CorDapps which have the same artifact name.

Hi, thanks for your report. However, I don't think I understand the issue. The cordformation plugin is installing the CorDapp with the precise file name that it has in the remote repository - which includes both its artifact name and version. Are you trying also to install a different CorDapp which nonetheless has the exact same file name (including its artifact name and version number) as the remote CorDapp? In which case, it would seem that we could modify cordformation, but this wouldn't change the fundamental problem which is that you would still have two different CorDapps with the same file name.

This issue occurs with corda-gradle-plugins version 5.0.13

FYI the latest release version is still 5.0.12.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/corda/corda-gradle-plugins/issues/360#issuecomment-804366785, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBZUTUNAZKBGCYKIZ47CATTE6RALANCNFSM4ULSQ27A.

chrisr3 commented 3 years ago

The problem occurs when installing multiple cordapps that have the same artifact name and version but different group names onto a node.

Yes, but in that case you have still created multiple different CorDapps with the exact same file names. The cordformation plugin is simply using the file names as they exist in the remote repositories, as they are understood by both Maven and Gradle.

Instead of asking all cordformation users to start downloading and installing CorDapps with file names that they do not expect, have you considered giving your own CorDapps unique artifact names in the first place? You have a far bigger issue than just cordformation - you have created CorDapps that cannot co-exist in the same directory at all.

nsmith00 commented 3 years ago

Hi Chris,

In maven terminology the cordformation plugin is ‘flattening’ the repo when copying the JAR files and in such cases the plugins always prepends the group name to avoid naming collisions, We have naturally discussed having unique artifact names for our cord apps but decided to raise this issue as we have unique group names which otherwise would be wasted,

Kind regards,

Nick

On 22 Mar 2021, at 23:01, Chris Rankin @.***> wrote:

The problem occurs when installing multiple cordapps that have the same artifact name and version but different group names onto a node.

Yes, but in that case you have still created multiple different CorDapps with the exact same file names. The cordformation plugin is simply using the file names as they exist in the remote repositories, as they are understood by both Maven and Gradle.

Instead of asking all cordformation users to start downloading and installing CorDapps with file names that they do not expect, have you considered giving your own CorDapps unique artifact names in the first place?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/corda/corda-gradle-plugins/issues/360#issuecomment-804424740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBZUTVTT2QYXH7QU4NDSHLTE645PANCNFSM4ULSQ27A.

nsmith00 commented 3 years ago

I would additionally say that I would absolutely agree that prepending the gradle/maven group name to the destination would be optional (and by default disabled) as users obviously we are the first to raise this issue. For your information, it is intended that we install cordapps from several vendors on the same node which could potentially have the same artifact name.

Kind regards,

Nick

chrisr3 commented 3 years ago

For your information, it is intended that we install cordapps from several vendors on the same node which could potentially have the same artifact name.

OK, but cordformation is only a testing tool, and your CorDapp file names would still clash in Production. I think you are tackling the wrong problem here.