SAP / cloud-sdk-java

Use the SAP Cloud SDK for Java to reduce development effort when building applications on SAP Business Technology Platform that communicate with SAP solutions and services such as SAP S/4HANA Cloud, SAP SuccessFactors, and many others.
Apache License 2.0
22 stars 14 forks source link

Gen folder is deleted from after switching to ODATA generator using EDMX #551

Closed Noorie123-github closed 2 months ago

Noorie123-github commented 3 months ago

Issue Description

We are trying to use the ODATA generator plug in instead of the com.sap.cloud.sdk.s4hana.datamodel.odata.namespaces.commercialproject format. But during mvn clean install, in the gen folder which is compiled in the srv/src folder, c4p folder containing the messageKeys is deleted and replaced with vdm folder. the expectation is that these folders should co-exists. Because of which we are facing issues during compilation

Important information:

Impact / Priority

We need to resolve these issues ASAP as this is a crucial step for the CAP 3.0 upgrade preparation which is targetted for 2409 release. Affected development phase: e.g. Development Impact: e.g. Blocked Timeline: e.g. code merge in 1 week ## Error Message : Compilation failure: [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/utils/AssignmentUtility.java:[25,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/handlers/AssignmentAPIServiceHandler.java:[43,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/validation/AssignmentDraftsValidator.java:[23,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/validation/AssignmentValidator.java:[32,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/utils/AssignmentDraftsUtility.java:[39,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/integration/UpdateSupplyCommand.java:[24,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/utils/AssignmentStatusValidationUtility.java:[12,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/handlers/CapacityGridServiceHandler.java:[59,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/validation/ValidatorFactory.java:[9,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/validation/CreateAssignmentForRequestedEffortDistributionValidator.java:[18,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/validation/CreateAssignmentValidator.java:[22,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/simulation/CreateAssignmentForRequestedEffortDistributionSimulator.java:[22,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/handlers/ResourceManagerAssignmentServiceHandler.java:[28,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/simulation/AssignmentSimulatorFactory.java:[8,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/handlers/AssignmentServiceHandler.java:[34,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/integration/AssignmentS4Integration.java:[38,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/utils/AssignmentDependentEntityUpdateUtility.java:[23,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/integration/SupplyDestination.java:[21,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/handlers/RequesterAssignmentServiceHandler.java:[16,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/handlers/ConsultantAssignmentServiceHandler.java:[26,37] package com.sap.c4p.rm.assignment.gen does not exist [ERROR] /C:/C4PRM_Repository/Repositories/Repository_For_Development/Resource-Management/Assignment/srv/src/main/java/com/sap/c4p/rm/assignment/handlers/IntegrationMonitorActionHandler.java:[19,37] package com.sap.c4p.rm.assignment.gen does not exist

Project Details

KavithaSiva commented 3 months ago

Hi @Noorie123-github,

I checked your plugin configuration and I think the issue occurs because of enabling the deleteOutputDirectory parameter:

<deleteOutputDirectory>true</deleteOutputDirectory>

This option will delete the contents of the output directory before generating the client. Please remove this parameter and that should fix your issue.

Regards, Kavitha

newtork commented 2 months ago

Also in upcoming release of SAP Cloud SDK 5.12.0 we improved the deletion feature:

  • [OpenAPI Generator] Setting the Maven plugin configuration property openapi.generate.deleteOutputDirectory to true will no longer result in deletion of all files from the outputDirectory prior to generation. Instead, only the apiPackage- and apiPackage-related directories will be cleaned. This reduces the risk of deleting files unexpectedly and allows for reusing the same outputDirectory for multiple generator plugin invocations.

Since you are working with old SAP Cloud SDK version 4, for which we can't offer further support, I'm closing the issue. If Kavitha's suggestion doesn't help here are more ideas: