AEM Eclipse plugin - New project creation issue - maven

I have installed AEM Eclipse plugin from https://eclipse.adobe.com/aem/dev-tools (I downloaded it as archive and used in my Eclipse as local archive).
Then I faced issue with AEM wizard not showing up while creating new project. Found workaround to download the archetype catalog xml file from https://repo.adobe.com/nexus/content/groups/public/archetype-catalog.xml and add it to Eclipse (Maven) as local archetype catalog. It started showing the AEM project when creating new project. I can see 3 archetypes in the dialog that opens after selecting New - AEM - AEM Sample Multi-Module Project.
I can see com.adobe.granite.archetypes:sample-project-archetype with 5, 6 and 7 versions. When I select version 7 (or even 5 and 6) and click on next button, it does not show the maven configuration dialog but stays on the same archetype selection dialog. When I click one more time, I can see the title of the dialog changes to "This step defines which server to use with the new project." but there are no options to select the server. In the eclipse log, I can see the error: "Unhandled event loop exception" and stack trace
java.lang.RuntimeException: Could not process archetype: null
at com.adobe.granite.ide.eclipse.ui.wizards.np.AdvancedSettingsComponent.initialize(AdvancedSettingsComponent.java:267)
at com.adobe.granite.ide.eclipse.ui.wizards.np.SimplerParametersWizardPage.setVisible(SimplerParametersWizardPage.java:160) ....
I have tried several options of changing the proxy settings, using externally installed maven and also trying to download the archetype jar separately from the server as suggested on some sites. But not able to make it work.
Any help would be appreciated.
I am using: Eclipse Java EE IDE for Web Developers. Version: Kepler Release Build id: 20130614-0229
Maven: apache-maven-3.1.1

I had the same problem and now i solved it. It seems the repository url in archetype catalog is not accessible. in my case it was proxy settings for https, which i set in settings.xml
as a check try to install the project from command line to see more information:
mvn archetype:generate -DgroupId=de.test -DartifactId=testAEM -DarchetypeArtifactId=sample-project-archetype -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeVersion=7 -DarchetypeCatalog=file://[path to aem archetype file]/archetype-catalog.xml -DinteractiveMode=true
Hope it helps

Related

Can't get IntelliJ to download Maven dependency

I'm trying to get Apache Log4j 2.9.0 into my IntelliJ Maven project, but am getting nowhere. This is the first time I've tried to use Maven with IntelliJ; I've been able to use it successfully with Eclipse in the past. (I'm using Windows 10 if it makes a difference.)
What I've tried:
1) In pom.xml, Alt+Insert -> Dependency, search for an artifact with log4j. It will find log4j 1.x, but not log4j-api or log4j-core which are needed for 2.x.
2) Downloaded log4j 2.9.0 from Apache. Their web site didn't tell me what to do with the file; after unzipping the download, I copied the top-level folder to .m2\repository. Retried searching for log4j, but it still couldn't find log4j 2.x stuff; tried various things like "Reimport all Maven projects", the Update button on the Settings page for Maven, Invalidate all caches and restart.... nothing has worked.
Edit: When I typed the above, I was sure there was a pom.xml file in my download. But I just double-checked and there wasn't. So I don't know whether any of the downloads on the Apache web page will work for Maven.
3) On the Settings page for Maven Repositories, tried "Test" on all the "Artifactory or Nexus Service URLs". The Test seemed to work fine.
4) On the Maven Settings page, changed Maven Home Directory from Bundled (Maven 3) to something inside Program Files (x86)\Jet Brains, which showed up on the drop-down menu. Didn't help.
I'm using IntelliJ Community Edition 2016.1.1, build #IC-145.597, Maven 3.0.5.
I must be missing a setting, but I can't figure out what. The documentation at https://www.jetbrains.com/help/idea/maven.html isn't helpful for solving this.

eclipse do not show the setting.xml for maven - i have downloaded luna full package

I am trying to set up maven in new eclipse - i have downloaded eclipse luna full package from eclipse site. but the settings xml for maven needs to be defined .
For the very first time - there are two ways to do this
1- Using Eclipse - embedded settings of maven
2- Using External Maven -
You can follow steps at - Maven in Eclipse: step by step installation
Then you need to create a simple maven project and clean-install it . It wil download all the basic required jars and all the basic plugins required for clean-compile-install operations.
Then you can start creating maven projects using maven archetypes

maven + elicpse related questions

Forgive me asking following questions. I am totally lost in regards to maven+eclipse. I checked out someone's java project (maven built) from SVN to my local eclipse (kepler). When I click Windows > Preferences, I see Maven.
question 1)
Is this a maven plugin? When developers say maven in eclipse, are they referring to maven plugin? maven and maven plugin are two separate components?
question 2)
when I click on user settings, C:\Users\myName.m2\settings.xml is missing. Exact error message is "User settings file doesn't exist". Does it get created when you install maven plugin at first time?
question 3)
I found three folders may have to do with maven C:\workspace\maven_local_repo_artifactory directory, C:\maven_local_repo and C:\Users\myName.m2\respository but not sure how they get created and what is the relationship among them.
question 4)
Is it ok to remove current maven plugin from eclipse and re-install it then check out the java project from SVN? I think my maven or maven plugin settings are not correct in my local box.
1) Is this a maven plugin? When developers say maven in eclipse, are
they referring to maven plugin? maven and maven plugin are two
separate components?
Yes. This is the maven-plugin. maven-plugin uses the configurations of maven (%M2_HOME%/conf).
If you wanna work with maven, you need to install it on your machine. Then you can run maven commmands. In addition, if you want to invoke maven commands within eclipse (conveniently) - you can install the eclipse-plugin. "maven-plugin" is a plugin for eclipse, that lets you use maven within Eclipse conveniently.
2) when I click on user settings, C:\Users\myName.m2\settings.xml is
missing. Exact error message is "User settings file doesn't exist".
Does it get created when you install maven plugin at first time?
By default, the maven-plugin assumes that your settings.xml (which is the configuration file of maven) is in the path you have mentioned. However, there are cases (like in my case) where the config file is not there, but under %M2_HOME%/conf. you can update it in Eclipse, and the error will disappear.
3) I found three folders may have to do with maven
C:\workspace\maven_local_repo_artifactory directory,
C:\maven_local_repo and C:\Users\myName.m2\respository but not sure
how they get created and what is the relationship among them.
C:\Users\myName.m2\respository is the "local repository". If you learned a bit about how maven works, it holds a local repo on the local machine, and it keeps there all artifacts. It downloads them from the "repository" - if you have one in your company (Nexus, Artifactory, etc) or from Maven Central. However, this path is configurable by Maven's settings. So there might be that someone played with it and changed the path, and these other directories were created. You did not mention what resides inside these paths...
4) Is it ok to remove current maven plugin from eclipse and re-install
it then check out the java project from SVN? I think my maven or maven
plugin settings are not correct in my local box.
Sure it is OK. You may remove the plugin, and the source plus maven itself will not be deleted from your machine.
HTH.

run maven project with eclipse

I'm new to maven and eclipse. I added m2e-plugin in eclipse and I imported an example of a maven project that I've found in the net.
My problem is when I try to run the project in eclipse using the Run as item menu, I don't find the maven package menu as I learned in the different tutorials.
Is it a problem of installation?
Ok, lets go through this step by step to make sure you have everything you need to get going.
First of all make sure that you have Maven installed (and lets assume you have Java already). You can download it from http://maven.apache.org/download.cgi and installation instructions for Fedora (which I assume is what you are using from your tag) are further down the page.
To test that Maven is correctly installed and working type mvn --help in to the terminal. Eclipse and m2e pretty much just hop on to the terminal for everything Maven related so make sure this is working before proceeding.
Next download an appropriate version of Eclipse. For the sake of this example I've downloaded the Kepler version of the Java EE IDE. In this version of Eclipse m2e comes bundled and to check this you can go to Help > About Eclipse > Installation Details and on the plug-ins tab you should see the m2e connectors.
Now you can import your Maven project in to Eclipse. To do this go to File > Import and then choose Existing Maven Projects under the Maven section. Choose the directory with the example project that you've downloaded and then Finish.
Now, ensure that you have some file inside your example Maven project opened and when you go to Run As... you should now be able to see the maven options. Go to Run As > Maven build... and all you need to do is place the word package in the Goals field and you're ready to roll.
Convert your project to a maven project if you haven't done yet by right clicking on your project in the Eclipse Project/Package explorer. Then follow:
Configure -> Convert to Maven Project
After that you can just right click again on the project Run as and you will see all Maven possibilities to execute your project build/install/clean etc.

MyEclipse 8.5 creating 'maven-archetype-quickstart' has encountered a prob?

I use the built-in maven of MyEclipse 8.5 to create maven projects.
It shows the following error:
Image is here:pic
Sorry, because I'm new I can't post pictures here yet.
I did it twice on two computers (both are MyEclipse 8.5), but the error was the same.
I use a Eclipse to do the same job and it is successful.
But when using MyEclipse 8.5 to do the job if check "create a simple project (skip archetype selection)" during the process, the project can be created and no error happens, but there is no the folder "Maven Dependencies" in the project created in Package Explorer.
Is this a bug of this version of MyEclipse? Because Eclipse Indigo works fine on this.
If you create a simple project, the folder Maven Dependencies is missing simply because there are no Maven Dependencies in a simple project. Just add a dependency, and the folder Maven Dependencies should be created with your dependency in it.

Resources