googlecodelabs / gcp-marketplace-integrated-saas

Apache License 2.0
20 stars 22 forks source link

Duplicate class error while building cloudcommerceprocurement jar #12

Open pjain1 opened 4 years ago

pjain1 commented 4 years ago

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 commented 4 years ago

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