Open Boltzmann opened 2 years ago
I have a similar problem. I'm using Maven 3.3.9 and Java 1.8. This is what I've done so far:
cd olingo-jpa-processor-v4\jpa-archetype\odata-jpa-archetype-spring
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${project.build.source}</source>
<target>${project.build.source}</target>
mvn clean install archetype:update-local-catalog
built OK for me but I had no archetype-catalog.xml
file anywhere in my (user home)/.m2
folder or its subfoldersmvn.cmd archetype:crawl
which generated me a (user home)/.m2/repository/archetype-catalog.xml
and that included the odata archetype I built in the earlier steps
<archetype>
<groupId>com.sap.olingo</groupId>
<artifactId>odata-jpa-archetype-spring</artifactId>
<version>1.0.9-SNAPSHOT</version>
<description>${rootArtifactId}-parent</description>
</archetype>
This is the command I'm running:
mvn.cmd archetype:generate -DarchetypeCatalog=local -DarchetypeGroupId=com.sap.olingo -DarchetypeArtifactId=odata-jpa-archetype-spring -DarchetypeVersion=1.0.9-SNAPSHOT -DgroupId=com.example -DartifactId=trippin -Dpunit=Trippin -Dschema=Trippin -Dentity-table=Person -Dvalue-object-table=Trip -DinteractiveMode=false
Initially it says
Archetype repository not defined. Using the one from [com.sap.olingo:odata-jpa-archetype-spring:1.0.9-SNAPSHOT] found in catalog local
but then later attempts to download from the remote, and fails with this message:
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.sap.olingo:odata-jpa-archetype-spring:1.0.9-SNAPSHOT)
So I am unable to use the Archetype to generate a project.
I have now got a workaround for this issue - follow the instructions in my previous comment above and then you also need to perform the archetype install process on the olingo-jpa-processor-v4\jpa-archetype\
folder.
Here are the extra steps needed:
cd olingo-jpa-processor-v4\jpa-archetype\
# Install the jpa-archetype in your local m2 repo
# It appears this is a parent of the odata-jpa-archetype-spring archetype
# and needs to be present for odata-jpa-archetype-spring to work properly
mvn.cmd clean install archetype:update-local-catalog
# Regenerate the archetype-catalog.xml
mvn.cmd archetype:crawl
# Contents of (user home)\.m2\repository\archetype-catalog.xml
# don't change after regeneration.
# The only com.sap.olingo archetype is this one still:
<archetype>
<groupId>com.sap.olingo</groupId>
<artifactId>odata-jpa-archetype-spring</artifactId>
<version>1.0.9-SNAPSHOT</version>
<description>${rootArtifactId}-parent</description>
</archetype>
cd ..\..\
# Maven archetype:generate command should now work successfully
# and create a project folder called trippin underneath the folder you're in
# when you run the command.
mvn.cmd archetype:generate -DarchetypeCatalog=local -DarchetypeGroupId=com.sap.olingo -DarchetypeArtifactId=odata-jpa-archetype-spring -DarchetypeVersion=1.0.9-SNAPSHOT -DgroupId=com.example -DartifactId=trippin -Dpunit=Trippin -Dschema=Trippin -Dentity-table=Person -Dvalue-object-table=Trip -DinteractiveMode=false
I was able to follow above steps by @esajic-ct . However, in my environment I get the messages from post https://github.com/SAP/olingo-jpa-processor-v4/issues/162#issuecomment-1208334320.
[...]
Done the other steps of https://github.com/SAP/olingo-jpa-processor-v4/issues/162#issuecomment-1208361497 too, but am still getting above messages. So the workaround does not work here.
The workaround produces the desired folder structure trippin.
I was running under the same issue too, and following @esajic-ct I was able to get further, but then I am getting the next error:
JDK: 17 Maven: 3.8.7
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.106 s [INFO] Finished at: 2023-02-02T16:44:15+01:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project hello: Unable to add module to the current project as it is not of packaging type 'pom' -> [Help 1]
Some related quick-start experiences:
update-local-catalog
step I had to build the project located in jpa
directory (artifacts are not available in maven central)
mvn clean install
jpa/pom.xml
surefire-plugin configuration (my local system's language is german)
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
[...]
<argLine>-Duser.language=en</argLine>
</configuration>
</plugin>
I use Intellij for development. Following the quick start guide I get no warning or error right clicking the
pom.xml
of odata-jpa-archetype-spring or following the guides command line ansatz. However, I do not get aarchetype-catalog.xml
whether with WSL2 on Windows 11 or Ubuntu 22.04.1 LTS both in the terminal or using Intellij Community or Ultimate. E.g. in the Ubuntu 22 bashmvn --version
givesThe text in QuickStart.md states
Without this I cannot choose the jpa archetype in the next step.