I did.
Also, I used instead of mavenCentral()
the path to the pom.xml which is in the same folder as settings.gradle
but no result.
Just to make you understand what I need to achieve:
<?xml version="1.0" encoding="UTF-8"?>
<modelVersion>4.0.0</modelVersion>
<name>polux</name>
<description>polux</description>
<groupId>com.albertosancheznieto</groupId>
<artifactId>polux-application</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<surefire.skipTests>false</surefire.skipTests>
<surefire.forkCount>1</surefire.forkCount>
<surefire.include>*</surefire.include>
<surefire.exclude />
<surefire.groups />
<surefire.excludedGroups />
<surefire.maxMemorySize>1024m</surefire.maxMemorySize>
<surefire.logLevel>info</surefire.logLevel>
<!--
Use the argLine property to define the arguments for the JVMs that are forked by the surefire plugin.
This avoids the need to use late property evaluation for configuring the jacoco plugin.
Relying on late evaluation of properties such as @{argLine} can result in issues with certain IDEs.
For more details, visit:
https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html
-->
<argLine>-Xmx${surefire.maxMemorySize} -Dorg.slf4j.simpleLogger.defaultLogLevel=${surefire.logLevel}</argLine>
<jacoco.executionDataFile>${project.build.directory}/coverage-reports/jacoco.exec</jacoco.executionDataFile>
<jacoco.includes>*</jacoco.includes>
<jacoco.excludes>org.apache.*</jacoco.excludes>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-bom</artifactId>
<version>4.31.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-core</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-generator</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-core</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-generator-maven-plugin</artifactId>
<!-- Please use the latest version here-->
<version>4.31.0</version>
<executions>
<execution>
<id>generate-productn</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>src/main/resources/com/albertosancheznieto/polux/oDataProduct</inputDirectory>
<outputDirectory>src/main/java/com/albertosancheznieto/polux/vdm</outputDirectory>
<deleteOutputDirectory>true</deleteOutputDirectory>
<packageName>com.albertosancheznieto.vdm</packageName>
<defaultBasePath>odata/v2/</defaultBasePath>
<compileScope>COMPILE</compileScope>
<serviceMethodsPerEntitySet>true</serviceMethodsPerEntitySet>
<!-- (Optional) You can add a custom copyright header:
<copyrightHeader>Copyright (c) this year, my company</copyrightHeader>
Or use the SAP copyright header:
<sapCopyrightHeader>true</sapCopyrightHeader>
-->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Here is the pom.xml
file and…
pluginManagement{
repositories{
gradlePluginPortal()
mavenCentral()
}
}
rootProject.name = ‘polux’
this is the settings.gradle
It´s clear for all of us that the dependencies can be loaded into gradle just by searching a bit on the internet, but what it is not that clear is how do I configure my project to launch this section of the pom.xml
→
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>com.sap.cloud.sdk.datamodel</groupId>
<artifactId>odata-generator-maven-plugin</artifactId>
<!-- Please use the latest version here-->
<version>4.31.0</version>
<executions>
<execution>
<id>generate-productn</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputDirectory>src/main/resources/com/albertosancheznieto/polux/oDataProduct</inputDirectory>
<outputDirectory>src/main/java/com/albertosancheznieto/polux/vdm</outputDirectory>
<deleteOutputDirectory>true</deleteOutputDirectory>
<packageName>com.albertosancheznieto.vdm</packageName>
<defaultBasePath>odata/v2/</defaultBasePath>
<compileScope>COMPILE</compileScope>
<serviceMethodsPerEntitySet>true</serviceMethodsPerEntitySet>
<!-- (Optional) You can add a custom copyright header:
<copyrightHeader>Copyright (c) this year, my company</copyrightHeader>
Or use the SAP copyright header:
<sapCopyrightHeader>true</sapCopyrightHeader>
-->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
The input directory contains an .EDMX file (a structure to help the librarlies to create entities based on) and in the output directory is where clases are created… Since none of the clases appears when I launch the program I supose that gradle can not read the pom.xml
.
Just tu avoid confusion here is a sh of the project structure:
I created the pom.xml
mannualy.
Thank you.