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

Duplicate class error while building cloudcommerceprocurement jar #12

Open
pjain1 opened this issue Jul 30, 2020 · 1 comment
Open

Duplicate class error while building cloudcommerceprocurement jar #12

pjain1 opened this issue Jul 30, 2020 · 1 comment

Comments

@pjain1
Copy link

pjain1 commented Jul 30, 2020

I have been following this - https://github.com/googlecodelabs/gcp-marketplace-integrated-saas/tree/master/java to generate cloudcommerceprocurement jar

I did the following -

wget 'https://cloudcommerceprocurement.googleapis.com/$discovery/rest?version=v1' -O discovery.json
python -m pip install google-apis-client-generator --user
~/Library/Python/2.7/bin/generate_library --input=discovery.json --language=java --output_dir=procurement

In the pom file of procurement project the version for google-api-client was set to 1.25.0-SNAPSHOT so I changed it to 1.25.0.

Now when I run mvn clean install, I get the following errors -

[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/model/ApproveEntitlementPlanChangeRequest.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.ApproveEntitlementPlanChangeRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/model/Consumer.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.Consumer
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/CloudCommercePartnerProcurementServiceRequestInitializer.java:[80,7] error: duplicate class: com.google.cloudcommerceprocurement.v1.CloudCommercePartnerProcurementServiceRequestInitializer
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/model/RejectEntitlementRequest.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.RejectEntitlementRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/model/ListAccountsResponse.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.ListAccountsResponse
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/model/Account.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.Account
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/model/Entitlement.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.Entitlement
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/model/ApproveEntitlementRequest.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.ApproveEntitlementRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/CloudCommercePartnerProcurementServiceRequest.java:[25,16] error: duplicate class: com.google.cloudcommerceprocurement.v1.CloudCommercePartnerProcurementServiceRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/model/Empty.java:[37,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.Empty
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/CloudCommercePartnerProcurementServiceScopes.java:[24,7] error: duplicate class: com.google.cloudcommerceprocurement.v1.CloudCommercePartnerProcurementServiceScopes
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/model/ResetAccountRequest.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.ResetAccountRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/model/ListEntitlementsResponse.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.ListEntitlementsResponse
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/model/Approval.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.Approval
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/model/RejectAccountRequest.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.RejectAccountRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/./com/google/cloudcommerceprocurement/v1/model/SuspendEntitlementRequest.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.SuspendEntitlementRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/model/ApproveAccountRequest.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.ApproveAccountRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/model/RejectEntitlementPlanChangeRequest.java:[31,13] error: duplicate class: com.google.cloudcommerceprocurement.v1.model.RejectEntitlementPlanChangeRequest
[ERROR] ~/work/gcp-marketplace-integrated-saas/java/procurement/com/google/cloudcommerceprocurement/v1/CloudCommercePartnerProcurementService.java:[40,7] error: duplicate class: com.google.cloudcommerceprocurement.v1.CloudCommercePartnerProcurementService
@pjain1
Copy link
Author

pjain1 commented Jul 30, 2020

It worked after I made this change in pom.xml of procurement project -
<sourceDirectory>.</sourceDirectory> to <sourceDirectory>com/</sourceDirectory>

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

1 participant