Maven Unable to Find AEM Archetype - maven

I've been starting at this problem for way to long... Im working through the Adobe wknd project and I can't get pass this command and most of the work is built off of it
mvn archetype:generate \
-DarchetypeGroupId=com.adobe.granite.archetypes \
-DarchetypeArtifactId=aem-project-archetype \
-DarchetypeVersion=18
I've tried it on the VPN and off, with all possible proxy configs and still getting the same error of
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.adobe.granite.archetypes:aem-project-archetype:18)
Deleting and reinstalling multiple times. Different networks and proxy configs as well Mac OS.
mvn -v returns
Maven home: /Users/dmills/Applications/apache-maven-3.6.1
Java version: 1.8.0_212, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.5", arch: "x86_64", family: "mac"
Get this error
Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.1.0:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.adobe.granite.archetypes:aem-project-archetype:18)
Build is failing and I don't know where to go now

The error indicates that there is no Maven repository configured that contains the archetype you want to use. Default Maven installations are not aware of the Adobe repository which contains the archetype. You have to configure the repository.
Usually, you should use the following repository for your AEM projects:
http://repo.adobe.com/nexus/content/groups/public
This repository contains the archetype you want to use:
https://repo.adobe.com/nexus/content/groups/public/com/adobe/granite/archetypes/aem-project-archetype/18/
Based on the documentation (see Links below) this would be a minimal Maven settings.xml that would allow you to use the AEM Maven archetype:
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>adobe-public</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<releaseRepository-Id>adobe-public-releases</releaseRepository-Id>
<releaseRepository-Name>Adobe Public Releases</releaseRepository-Name>
<releaseRepository-URL>http://repo.adobe.com/nexus/content/groups/public</releaseRepository-URL>
</properties>
<repositories>
<repository>
<id>adobe-public-releases</id>
<name>Adobe Basel Public Repository</name>
<url>http://repo.adobe.com/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>adobe-public-releases</id>
<name>Adobe Basel Public Repository</name>
<url>http://repo.adobe.com/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
Note: I set activeByDefault to true for the adobe-public profile. This way you do not need to pass -Padobe-public on the command line to activate the profile.
Now, if you run the following command you should be able to use the archetype:
mvn archetype:generate \
-DarchetypeGroupId=com.adobe.granite.archetypes \
-DarchetypeArtifactId=aem-project-archetype \
-DarchetypeVersion=18
Links:
https://helpx.adobe.com/experience-manager/kb/SetUpTheAdobeMavenRepository.html

In the Adobe profile the 'settings' xml tag is missing:
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
.....
</profile>
</profiles>
</settings>

Just update the settings.xml file in the m2 folder. Please look into the below link if you are using archtype 13 and 6.4
https://helpx.adobe.com/experience-manager/using/maven_arch13.html
Also in the profile tag please update the adobe repo url to 'https' instead of http.

Related

Mule XML SDK and its Error in Maven Settings.xml

I'm doing the XML SDK in Mule 4.2.2 with Maven 3.6.3 [though Mule inbuild using (3.6.9)] and AnypointStudio 7.4.2 . Please clarify my doubts
1) Is that XML SDK connectorPlugin creation is supported only in Mule-EE version or public?
2) I'm using the below Maven command and settings.xml , which is throwing 401 Unauthorized (Warning) and error as 'Archetype' issue.
mvn archetype:generate -DarchetypeGroupId=org.mule.extensions -DarchetypeArtifactId=xml-mule-extensions-archetype -DarchetypeVersion=1.0.1 -DgroupId=org.mule.extension -DartifactId=error-handler-framework -DmuleConnectorName=ErrorHandler
Error I'm getting as below. But i can able to assess this URL https://repository.mulesoft.org/releases/ without Login. Not sure why its throwing 401
[WARNING] Failure to transfer org.mule.tools/maven-metadata.xml from
https://repository.mulesoft.org/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of mulesoft-releases has elapsed or updates are forced. Original error: Could not transfer metadata org.mule.tools/maven-metadata.xml from/to mulesoft-releases (https://repository.mulesoft.org/releases/): authenticationrequired (401)
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.mule.tools, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\jxsubr\.m2\repository), mulesoft-releases (https://repository.mulesoft.org/releases/), central (https://repo.maven.apache.org/maven2)]
Below is the settings.xml
<?xml version="1.0"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>C:\Users\star\.m2\repository</localRepository>
<profiles>
<profile>
<id>Mule</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
</repositories>
</profile>
<profile>
<id>standard-repositories</id>
<repositories>
<repository>
<id>Central</id>
<name>Central</name>
<url>http://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-ee-release</id>
<url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
..............
</profile>
I also tried giving Public Repo, instead Mule-ee in the above settings. Still the same error. Please direct me a standard settings.xml for Mule if any.
3) Though Mule inbuild for this runtime 4.2.2 using Maven 3.6.9. Can we use lower version 3.6.3 (I believe this is the stable version now)?
Reference: https://docs.mulesoft.com/mule-sdk/1.1/xml-sdk
Thanks in advance for your help. Please let me know if needed more information.
I think you need to declare the repos as pluginRepositories too for the archetype to work. HTH
This dependency is available only for MuleSoft Enterprise Maven customer repository only.
IN XML SDK other than transform message this ee xsd may not require., I have created a log forwarder without using this dependency.
Log Forwarding Connector Mule XML-SDK - DZone
https://dzone.com/articles/mule-log-forwarder-connector-xml-sdk
https://docs.mulesoft.com/mule-runtime/3.6/configuring-maven-to-work-with-mule-esb#%C2%A0referencing-mulesoft-s-enterprise-repositories.

Maven could not resolve dependency of WebSphere provided dependency

I am trying to import a legacy application on IntelliJ and most of the modules have dependencies to com.ibm.tools.target.was and com.ibm.tools.target.portal artifacts.
I am getting this in the Maven window of IntelliJ:
This is the error message I am getting on mvn install:
Failed to execute goal on project xxx-managers: Could not resolve dependencies for project com.xxx.xxx.xxx-managers:xxx-managers:ejb:0.0.1-SNAPSHOT: Failure to find com.ibm.tools.target:was:pom:8.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
I tried to imitate a similar procedure found in the IBM web knowledge center (https://www.ibm.com/support/knowledgecenter/en/SSHR6W/com.ibm.websphere.wdt.doc/topics/install_server_apis.html) but it did not work.
I added the was_public.pom as maven project and imported the project as a dependency to my other module.
I also tried to add WebSphere as a library dependency:
Nothing worked.
Please help, thanks in advance.
EDIT: This is my settings.xml (I copied it from an other environment in which the application is working) and it includes IBM repositories:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
<id>ibm-maven-repo</id>
<name>ibm-maven-repo</name>
<url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
<id>ibm-maven-repo</id>
<name>ibm-maven-repo</name>
<url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/</url>
</pluginRepository>
</pluginRepositories>
<id>standard-extra-repos</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>standard-extra-repos</activeProfile>
</activeProfiles>
</settings>
You miss some artifacts, e.g. com.ibm.tools.target:was:pom:8.0.0, and you need to either specify a repository in your settings.xml, where it should come from or install these artifacts into your local repository.

Maven reports 'The desired archetype does not exist' when using archetype from bintray

First, I install archetype to my local repository:
mvn dependency:get \
-Dartifact=org.teavm.flavour:teavm-flavour-application:0.1.0-dev-8 \
-DremoteRepositories=teavm::::https://dl.bintray.com/konsoletyper/teavm
Second, I run archetype generation:
mvn -DarchetypeCatalog=local \
-DarchetypeGroupId=org.teavm.flavour \
-DarchetypeArtifactId=teavm-flavour-application \
-DarchetypeVersion=0.1.0-dev-8 \
archetype:generate
and get the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate
(default-cli) on project standalone-pom: The desired archetype does not exist
(org.teavm.flavour:teavm-flavour-application:0.1.0-dev-8) -> [Help 1]
When I build the project from sources and generate SNAPSHOT archetype, everything works fine.
Is there something I'm doing wrong, or it's a bug in Maven? Is there a workaround?
Please go to https://bintray.com/konsoletyper/teavm/teavm-flavour-dev
Then hit Set Me Up!
And choose: Resolving artifacts using Maven
copy this part into your settings xml (usually located in /Users/os-username/.m2/settings.xml see bellow):
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-konsoletyper-teavm</id>
<name>bintray</name>
<url>http://dl.bintray.com/konsoletyper/teavm</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-konsoletyper-teavm</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/konsoletyper/teavm</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
Then try the second command again.
settings.xml:
There are two locations where a settings.xml file may live:
The Maven install: ${maven.home}/conf/settings.xml
A user’s install: ${user.home}/.m2/settings.xml
https://maven.apache.org/settings.html
I had the same issue and fixed it by adding the plugin "Maven Archetype Catalogs" that fetch for external archetype catalog files.
Go to Preferences by taping ⌘, (macOS), or Ctrl+Alt+S (Windows/Linux) then Plugins and look for Maven Archetype Catalogs.

Why Artifactory Maven and Oracle fail to communicate?

I hope an answer will be a universal guide on how to connect Maven, Oracle And Artifactory and will become most usefull webpage on the net. Most likely this question will be marked down, but I just give up on Maven, Artifactory and Oracle.
I am running windows 7-64 with maven installed as a part of Oracle jdev. Company has Artifactory setted up and running on vpn network.... but somethings are not right.
Following simple instructions on:
http://biemond.blogspot.co.uk/2013/07/maven-support-in-weblogic-jdeveloper.html
fails at first instruction:
Install the oracle maven sync plugin to your local repository
the command:
mvn deploy:deploy-file -DpomFile=oracle-maven-sync.12.1.2.pom -Dfile=oracle-maven-sync.12.1.2.jar
the error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: The parameters 'url' for goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file are missing or invalid -> [Help 1]
adding
-Durl=file://C:\Users\{user}\.m2
seems to install that artifact to my local .m2 repo
C:\Users\{user}\.m2\com\oracle\maven\oracle-maven-sync\12.1.2-0-0
but only seems, then I get to number 3 on that tutorial:
mvn com.oracle.maven:oracle-maven-sync:help
gives an error:
[ERROR] Error resolving version for plugin 'com.oracle.maven:oracle-maven-sync' from the repositories [local (C:\Users\{user}\.m2), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]
So the plugin failed to install?
Oracle Maven repository is password protected due to weird oracle thoughts, Artifactory has external Central and Oracle repositories why letting it mirror everything stops maven from even finding deploy module?
here is my settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>user</username>
<password>xxx</password>
<id>central</id>
</server>
<server>
<username>user</username>
<password>xxx</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release-local</name>
<url>http://art.host.ru:8081/artifactory/libs-release-local</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot-local</name>
<url>http://art.host.ru:8081/artifactory/libs-snapshot-local</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release-local</name>
<url>http://art.host.ru:8081/artifactory/plugins-release-local</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot-local</name>
<url>http://art.host.ru:8081/artifactory/plugins-snapshot-local</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
<profile>
<id>oracle-maven</id>
<properties>
<oracle-maven-sync.oracleHome>C:\Oracle\Middleware\Oracle_Home</oracle-maven-sync.oracleHome>
<oracle-maven-sync.testOnly>false</oracle-maven-sync.testOnly>
<oracle-maven-sync.failOnError>false</oracle-maven-sync.failOnError>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>oracle-maven</activeProfile>
</activeProfiles>
</settings>
Well, I think you just follow the wrong guide. All this manual deployment of some random maven plugins is just wrong.
Just follow the simple and detailed instructions in the Artifactory User Guide and you're good to go.
The problem is with the -Dmaven.repo.local
Do not provide the argument.
Use http://jcenter.bintray.com for most of the artifacts
And for Oracle: oracle-maven-sync plugin
oracle instructions
$ORACLE_HOME = where jdev 12.1.2
$M2_HOME = $ORACLE_HOME/oracle_common/modules/org.apache.maven_3.0.4
$M2 = $M2_HOME/bin (add to $PATH)
artifactory->home->maven settings generate settings.xml put it in ~/.m2
create local repo in artifactory"oracle-local-12.1.2"
settings.xml add following code
<profiles>
<profile>
<properties>
<oracle-maven-sync.oracleHome>$ORACLE_HOME</oracle-maven-sync.oracleHome>
<oracle-maven-sync.testOnly>false</oracle-maven-sync.testOnly>
<oracle-maven-sync.failOnError>false</oracle-maven-sync.failOnError>
<oracle-maven-sync.serverId>oracle-local-12.1.2</oracle-maven-sync.serverId></properties>
artifactory -> username(top right corner) -> enter pass -> unlock -> забрать encrypted password(copy)
add aquired pass to settings.xml for all
go to $ORACLE_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.2 (use cmd/terminal)
mvn deploy:deploy-file -DpomFile=oracle-maven-sync-12.1.2.pom -Dfile=oracle-maven-sync-12.1.2.jar
test it: mvn com.oracle.maven:oracle-maven-sync:help
push artifacts oracle 12.1.2 mvn com.oracle.maven:oracle-maven-sync:push
long time wait (~3000 artifacts > 2 hours)
complete set up of repos and in settings.xml

build errors Access denied to neo4j-server-2.0-SNAPSHOT-tests.jar

Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)
Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
(building 2.0 snapshot) How to reproduce :
https://gist.github.com/anonymous/6118671
[ERROR] Failed to execute goal on project neo4j-server-advanced: Could
not resolve dependencies for project
org.neo4j.app:neo4j-server-advanced:jar:2.0-SNAPSHOT: Could not
transfer artifact org.neo4j.app:neo4j-server:jar:tests:2.0-SNAPSHOT
from/to tinkerpop-repository (http://tinkerpop.com/maven2): Access
denied to:
http://tinkerpop.com/maven2/org/neo4j/app/neo4j-server/2.0-SNAPSHOT/neo4j-server-2.0-SNAPSHOT-tests.jar,
ReasonPhrase:Forbidden. -> [Help 1]
any ideas?
It's likely you won't find that jar in the tinkerpop maven repository.
Here's a settings.xml file with the correct location of the Neo4j snapshot repository:
http://dist.neo4j.org/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>neo4j</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>neo4j-release-repository</id>
<name>Neo4j Maven 2 release repository</name>
<url>http://m2.neo4j.org/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>neo4j-snapshot-repository</id>
<name>Neo4j Maven 2 snapshot repository</name>
<url>http://m2.neo4j.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</profile>
</profiles>
</settings>
Taking a look, the artifacts in there look slightly outdated.
So to get a fresh version, you could just do mvn install on the module in community/server first.
I fixed it by
% perl -p -i.bak -e 's{tinkerpop.com}{repo.maven.apache.org}g' advanced/server-advanced/pom.xml
% perl -p -i.bak -e 's{tinkerpop.com}{repo.maven.apache.org}g' enterprise/server-enterprise/pom.xml

Resources