on 2024 Jun 27 4:57 AM
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
we resolved it, thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.