AEM 6.5.0 - Maven Archetype Project - Build Failure - aem

I'm creating an AEM project using Maven Archetype but I keep getting errors:
[WARNING] Archetype not found in any catalog. Falling back to central repository.
[WARNING] The POM for com.adobe.aem:aem-project-archetype:jar:23 is missing, no dependency information available
[ERROR] 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.adobe.aem:aem-project-archetype:23) -> [Help 1]
AEM Version: 6.5.0
Java Version: 11.0.17
Maven Version: 3.8.6
Commands used:
mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate -D archetypeGroupId=com.adobe.granite.archetypes -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=23 -D appTitle="My Site" -D appId="mysite" -D groupId="com.mysite" -D frontendModule=general
mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=23 -D appTitle="My Site" -D appId="mysite" -D groupId="com.mysite" -D frontendModule=general
I tried many archetype versions (older and newer than the required one "23")
and tried these solutions but didn't solve the problem:
Cannot build a project using maven archetype installed locally
Maven Unable to Find AEM Archetype

Try adding -P adobe-public to the maven command.

Related

Building Apache Spark 2.1.0 from source fails

Am trying to build Apache Spark 2.1.0 source, but get these errors below that baffle me...
Hadoop 2.8.0 was installed and is working
Scala 2.12.1 was installed in advance of executing the Spark install (Which seems to auto install Scala 2.11.8 ?!?)
My build line is:
build/mvn -Pyarn -Phadoop-2.7 -Dhadoop.version=2.7.0 -DskipTests clean package
Does anybody know why I get:
user#server:/usr/local/share/spark/spark-2.1.0$ sudo /usr/local/share/spark/spark-2.1.0/build/mvn -Pyarn -Phadoop-2.7 -Dhadoop.version=2.7.0 -DskipTests clean package
[sudo] password for user:
exec: curl --progress-bar -L https://downloads.typesafe.com/zinc/0.3.9/zinc-0.3.9.tgz
######################################################################## 100.0%
exec: curl --progress-bar -L https://downloads.typesafe.com/scala/2.11.8/scala-2.11.8.tgz
######################################################################## 100.0%
exec: curl --progress-bar -L https://www.apache.org/dyn/closer.lua?action=download&filename=/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
######################################################################## 100.0%
Using `mvn` from path: /usr/local/share/spark/spark-2.1.0/build/apache-maven-3.3.9/bin/mvn
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
[INFO] Scanning for projects...
Downloading: https://repo1.maven.org/maven2/org/apache/apache/14/apache-14.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.apache.spark:spark-parent_2.11:2.1.0: Could not transfer artifact org.apache:apache:pom:14 from/to central (https://repo1.maven.org/maven2): repo1.maven.org: Name or service not known and 'parent.relativePath' points at wrong local POM # line 22, column 11
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.apache.spark:spark-parent_2.11:2.1.0 (/usr/local/share/spark/spark-2.1.0/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.apache.spark:spark-parent_2.11:2.1.0: Could not transfer artifact org.apache:apache:pom:14 from/to central (https://repo1.maven.org/maven2): repo1.maven.org: Name or service not known and 'parent.relativePath' points at wrong local POM # line 22, column 11: Unknown host repo1.maven.org: Name or service not known -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
I tested downloading manually (To see if that was causing the errors), which downloads without issues:
https://repo1.maven.org/maven2/org/apache/apache/14/apache-14.pom
I also tested accessing the URL below, which also shows content:
https://repo1.maven.org/maven2
Hope somebody smart knows how to solve this...
I found out what the issue was:
I had to configure our proxy settings in the SETTINGS.XML in the directory:
/usr/local/share/spark/spark-2.1.0/build/apache-maven-3.3.9/conf
After editing the file, the build went without any issues :)
Hope this helps someone else running into the same issue...
EDIT: Just to be extra clear, having a working proxy configuration in bash only is NOT SUFFICIENT for the Maven Build to succeed. I was able to download all files from bash manually, but Maven needed the proxy configuration in the SETTINGS.XML file present as well...

maven in command line succeed, but failed when using the same maven in eclipse

I'm trying to build the project of hadoop. I followed the official document as follows on how to do that.
http://wiki.apache.org/hadoop/HowToContribute
https://wiki.apache.org/hadoop/EclipseEnvironment
I've git clone the project, maven install it successfully, but when I import the project, or even a sub-project like 'hadoop-yarn-api', I got the following errors on maven:
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (execution: compile-protoc, phase: generate-sources) pom.xml /hadoop-yarn-api line 73 Maven Project Build Lifecycle Mapping Problem
Then I'm trying to mvn clean install the project via External Tools Configuration in eclipse, it also failed on:
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-yarn-api: org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did not return a version -> [Help 1]
But the curious part is that when I cd into the root directory of 'hadoop-yarn-api' and invoke mvn clean install, it can be built successfully.
I'm using m2ecipse in eclipse, and I'm sure that I've changed to the maven which is exactly the one that I'm used in command line, not the embedded one.
And I've installed protocol buffers 2.5.0:
$ protoc --version
libprotoc 2.5.0
Could anyone give me some idea? Many thanks!
P.S.
Eclipse Java EE IDE - Juno Service Release 2
m2e - 1.4.1.20140328-1905
Mac 1- 0.9.4
maven - 3.0.5
Hadoop - 2.2.0

Maven works but eclipse error

I created a maven project from the command-line interface. Configured the dependencies with my other maven projects. Now when I run my project, it works without any problem using the following maven command:
$ mvn clean
$ mvn install
$ mvn exec:java
Hello world!
Then, I use the following maven command to have my eclipse project files.
$ mvn eclipse:eclipse
I go and open my project using Eclipse Kepler, however as you can see there is a exclamation point on my project and it does not run from eclipse.
The problem is I do not know how to find the error on eclipse..

How to get maven 3.0 to only build modules with local scm changes

In maven 2.x you could use the reactor:make-scm-changes to build only modules with local scm changes.
Running this module with maven 3.0.3 results in a failure
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-reactor-plugin:1.0
:make-scm-changes (default-cli) on project my-project: The parameters 'artifactLis
t', 'folderList' for goal org.apache.maven.plugins:maven-reactor-plugin:1.0:make
-scm-changes are missing or invalid -> [Help 1]
This post seems to indicate there is no equivalent functionality for maven 3.0
http://mail-archives.apache.org/mod_mbox/maven-dev/201011.mbox/%3calpine.OSX.2.00.1011051125410.368#dfab-2.local%3e
Is there a replacement in maven 3.0 to get the functionality to only build modules that have local scm changes?
You could roll your own with a shell script that centers around:
svn --non-interactive status
Your shell script could do something like so:
PROJECT_LIST=`svn --non-interactive status | filter out target dir \
| cut out status \
| cut out subdirectories \
| replace line endings with ','`
mvn $* --projects=$PROJECT_LIST
I didn't test it out, but I know it's possible in theory.

Create a Maven project with hibernate

I need to create a maven project, which also has hibernate. How do i write the maven create project command.
The IDE i'm using is Eclipse.
If you're asking what archetype would be best to use from the command line, then the below will give you a nice list to choose from:
mvn archetype:generate
However, you say you're using Eclipse - if so, take advantage of the Maven integration and you'll be offered a similar choice when creating the project (basically just a nice GUI around archetype:generate and friends)
What you need is an appropriate maven archetype E.g.:
mvn archetype:generate -B \
-DgroupId=com.my-company.my-project \
-DartifactId=my-project-domain \
-DpackageName=com.company.project.domain \
-DarchetypeGroupId=com.rfc.maven.archetypes \
-DarchetypeArtifactId=jpa-maven-archetype \
-DremoteRepositories=http://maven.rodcoffin.com/repo \
-DarchetypeVersion=1.0.0
You can find some Hibernate archetypes here http://docs.codehaus.org/display/MAVENUSER/Archetypes+List
or use google