cancel
Showing results for 
Search instead for 
Did you mean: 

for using odata api, we need gradle version in place of maven, how to solve it

khksoft
Explorer
0 Kudos
154

sap cloud sdk suggested using maven for creating odata api on local development.

but we need gradle version and converted maven version into gradle version

but we failed on "gradle build". how to solve it

- maven version

<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-generator-maven-plugin</artifactId>
<version>${cloud-sdk.version}</version>
<executions>
<execution>
<id>generate-consumption</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>${project.basedir}/src/main/resources/edmx</inputDirectory>
<outputDirectory>${project.build.sourceDirectory}</outputDirectory>
<packageName>com.sap.cloud.sdk.tutorial.datamodel.odata</packageName>
<serviceNameMappingFile>${project.basedir}/src/main/resources/serviceNameMappings.properties</serviceNameMappingFile>
<compileScope>COMPILE</compileScope>
<overwriteFiles>true</overwriteFiles>
</configuration>
</execution>
</executions>
</plugin>

- gradle verison

import com.sap.cloud.sdk.datamodel.odata.generator.DataModelGenerator
--> in the part, error occured, "not resolve class"

tasks.register('generateOData') {
doLast {
def generator = new com.sap.cloud.sdk.datamodel.odata.generator.DataModelGenerator()

generator.setInputDirectory(file("${projectDir}/src/main/resources/edmx"))
generator.setOutputDirectory(file("${projectDir}/src/main"))
generator.setPackageName("com.sks.erpbss.be.cs.datamodel.odata")
generator.setServiceNameMappingFile(file("${projectDir}/src/main/resources/serviceNameMappings.properties"))
generator.setCompileScope(ODataGeneratorPlugin.CompileScope.COMPILE)
generator.setOverwriteFiles(true)

generator.generate()
}
}
compileJava.dependsOn generateOData

 

khksoft
Explorer
0 Kudos
we resolved it, thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

khksoft
Explorer
0 Kudos

we resolved it, thanks