Fórum

Error creating Liferay plugin project.

thumbnail
Sergio Romero, modificado 9 Anos atrás.

Error creating Liferay plugin project.

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
Use "liferay-ide-eclipse-windows-x64-2.2.2-ga3-201501300730.zip"
Case use:
1 clic from wizard "New Liferay Plugin Projetc"
2 Use Maven
3 --> See message for log -> ERROR -> Error creating Liferay plugin project.

Error creating Liferay plugin project.

org.eclipse.core.runtime.CoreException: Could not resolve archetype com.liferay.maven.archetypes:liferay-portlet-archetype:6.2.2 from any of the configured repositories.
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.resolveArchetype(ProjectConfigurationManager.java:836)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects0(ProjectConfigurationManager.java:743)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:719)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:1)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:166)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:142)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:96)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1348)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects(ProjectConfigurationManager.java:717)
	at com.liferay.ide.maven.core.LiferayMavenProjectProvider.doCreateNewProject(LiferayMavenProjectProvider.java:200)
	at com.liferay.ide.project.core.NewLiferayProjectProvider.createNewProject(NewLiferayProjectProvider.java:45)
	at com.liferay.ide.project.core.model.NewLiferayPluginProjectOpMethods.execute(NewLiferayPluginProjectOpMethods.java:109)
	at com.liferay.ide.project.core.model.NewLiferayPluginProjectOp$Impl.execute(Unknown Source)
	at org.eclipse.sapphire.ui.forms.swt.SapphireWizard.performFinish(SapphireWizard.java:370)
	at org.eclipse.sapphire.ui.forms.swt.SapphireWizard$3.run(SapphireWizard.java:334)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.eclipse.core.runtime.CoreException: Could not resolve artifact com.liferay.maven.archetypes:liferay-portlet-archetype:pom:6.2.2
	at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:769)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl$5.call(MavenImpl.java:1)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:166)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:109)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:96)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:736)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.resolve(MavenImpl.java:713)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.resolveArchetype(ProjectConfigurationManager.java:829)
	... 15 more



Any solution?

I can create the project manually, but I need to train users and this bug more difficult work to beginners.

I see ticket issue ->Issue JIRA- Liferay - IDE-1820
thumbnail
Sergio Romero, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
I have seen various post on the forum, with similar problems, but no solution for this problem.

https://www.liferay.com/es/community/forums/-/message_boards/message/32997382

https://www.liferay.com/es/community/forums/-/message_boards/message/32575838

Any idea?
thumbnail
Gregory Amerson, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Liferay Legend Postagens: 1123 Data de Entrada: 16/02/10 Postagens Recentes
Hey Sergio,

We will look into this and try to reproduce this issue with the version you indicated and will follow up here.
thumbnail
Sergio Romero, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
I look forward hearing from you. Thanks
thumbnail
Gregory Amerson, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Liferay Legend Postagens: 1123 Data de Entrada: 16/02/10 Postagens Recentes
Hey Sergio,

We have not been able to replicate this problem on our test machines. Is there anything else in your environment that may be affecting this? Custom profiles, custom settings in ~/.m2/settings.xml, like mirrors or proxies?

Does new maven archetype generation work from the command line?

mvn archetype:generate \
     -DarchetypeArtifactId=liferay-portlet-archetype \
     -DarchetypeGroupId=com.liferay.maven.archetypes \
     -DarchetypeVersion=6.2.2 \
     -DartifactId=sample-portlet \
     -DgroupId=com.liferay.sample \
     -Dversion=1.0-SNAPSHOT


That should be the equivalent code that is being executed in the IDE (but IDE uses the maven APIs directly).
thumbnail
Sergio Romero, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
My config:
Windows 7
Eclipse Java EE IDE for Web Developers.
Version: Luna Service Release 2 (4.4.2)
Build id: 20150219-0600
Liferay IDE 2.2.2.201501300730-ga3 com.liferay.ide.eclipse.tools.feature.group Liferay, Inc.
Liferay IDE AlloyUI 2.2.2.201501300730-ga3 com.liferay.ide.alloy.feature.group Liferay, Inc.


My settings.xml
<settings>
	<localrepository>D:/maven/.m2 </localrepository>
	<proxies>
		<proxy>
			<id>MyProxyDomain</id>
			<active>true</active>
			<protocol>http</protocol>
			<host>proxy.myDomain.es</host>
			<port>8080</port>
			<username>MyUSER</username>
			<password>MyProxy</password>			
			<nonproxyhosts>127.0.0.1|localhost|*.myDomain.es</nonproxyhosts>
		</proxy>
	</proxies>
	<mirrors>
		<mirror>
			<id>liferay-ce</id>
			<mirrorof>*</mirrorof>
			<url>https://repository.liferay.com/nexus/content/groups/liferay-ce
			</url>
		</mirror>
		<mirror>
			<id>liferay-snapshots-ce</id>
			<url>https://repository.liferay.com/nexus/content/repositories/liferay-snapshots-ce/
			</url>
			<mirrorof>liferay-snapshots-ce</mirrorof>
		</mirror>
		<mirror>
			<id>maven-repository</id>
			<mirrorof>*</mirrorof>
			<url>http://maven-repository.com</url>
		</mirror>
		<mirror>
			<id>mvnrepository</id>
			<mirrorof>*</mirrorof>
			<url>http://mvnrepository.com</url>
		</mirror>
		<mirror>
			<id>maven</id>
			<mirrorof>*</mirrorof>
			<url>http://repo.maven.apache.org/maven2</url>
		</mirror>
	</mirrors>
</settings>


If I execute maven sentence in the command line ->


D:\Proyectos\testProject&gt;mvn archetype:generate -DarchetypeArtifactId=liferay-portlet-archetype -DarchetypeGroupId=com.liferay.maven.archetypes -DarchetypeVersion=6.2.2 -DartifactId=sample-portlet -DgroupId=com.liferay.sample -Dversion=1.0-SNAPSHOT


Getting error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.791s
[INFO] Finished at: Mon Mar 16 10:46:18 CET 2015
[INFO] Final Memory: 8M/182M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [or
apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (D:\maven\.m2), li
ray-ce (https://repository.liferay.com/nexus/content/groups/liferay-ce)] -&gt; [Help 1]
[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 ar
cles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
thumbnail
Gregory Amerson, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Liferay Legend Postagens: 1123 Data de Entrada: 16/02/10 Postagens Recentes
Thanks for the detailed error report. Now we can see some interesting information:

[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [or
10apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (D:\maven\.m2), li
11ray-ce (https://repository.liferay.com/nexus/content/groups/liferay-ce)] -&gt; [Help 1]


So it seems that mvn is trying to lookup the archetype plugin from the liferay repository. So the mvn should be looking here: https://repo1.maven.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/ for the plugin code. But you can see on the liferay-ce nexus repository there is no such plugin https://repository.liferay.com/nexus/content/groups/liferay-ce/org/apache/maven/plugins/maven-archetype-plugin/

So that means your .m2/settings.xml will likely need to be reconfigured to allow the maven-archetype-plugin to be found from the proper maven central repo.

I'm not entirely sure how maven handles ordering of mirrors in the .m2/settings.xml. But could you try temporarily removing some or all of those mirrors to see if that allows the archetype generation to work? i.e. allow the mvn executable to be able to find the maven-archetype-plugin on central?
thumbnail
Sergio Romero, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
I made test with each of the repositories. Independently. I've even done test, without using the proxy with a USB-3G. The result is the same.

There are more users with this problem.

With "Liferay IDE 2.0.0.201312200205-ga1", it works well.
With "Liferay IDE 2.2.2.201501300730-ga3", don't works.
thumbnail
Gregory Amerson, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Liferay Legend Postagens: 1123 Data de Entrada: 16/02/10 Postagens Recentes
Sergio Romero:
I made test with each of the repositories. Independently. I've even done test, without using the proxy with a USB-3G. The result is the same.

There are more users with this problem.

With "Liferay IDE 2.0.0.201312200205-ga1", it works well.
With "Liferay IDE 2.2.2.201501300730-ga3", don't works.



This is an interesting data-point. In IDE 2.0.0 we were dynamically downloading the latest lists of liferay archetypes and going with the latest released version, but then we realized this isn't the correct behavior. And in IDE 2.2.2 all liferay archetypes default to this value:

com.liferay.maven.archetypes:liferay-*-archetype:6.2.1


If you want to change this value you can do it in two ways...
1. global pref page (Window > Prefs > Liferay > maven) set the archetype value in GAV form
2. on each invocation of the "new liferay plugin project" wizard, on the 2nd page at the bottom for portlets you can see we have an option for specifically the archetype that will be used.

I realize with #2 this option is not available for theme projects, for those you will have to use option #1.

So perhaps you knew this already and have set that value to 6.2.2? that is why you get the error about not being able to find 6.2.2 in your error log.
thumbnail
Sergio Romero, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
Thanks Greg,

This you say I tested too. If you view the log of the first post, you will see the version 6.2.2. I changed manually as you say.

Error creating Liferay plugin project.
 
org.eclipse.core.runtime.CoreException: Could not resolve archetype com.liferay.maven.archetypes:liferay-portlet-archetype:6.2.2 from any of the configured repositories
thumbnail
Gregory Amerson, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Liferay Legend Postagens: 1123 Data de Entrada: 16/02/10 Postagens Recentes
Sergio Romero:
Thanks Greg,

This you say I tested too. If you view the log of the first post, you will see the version 6.2.2. I changed manually as you say.

Error creating Liferay plugin project.
 
org.eclipse.core.runtime.CoreException: Could not resolve archetype com.liferay.maven.archetypes:liferay-portlet-archetype:6.2.2 from any of the configured repositories


Ok, I see. So now the trick is for us to replicate the problem in our environment. Right now when we specify 6.2.2 archetype settings (in either wizard or in pref) it resolves and the project wizard completes. So that means we just have to find the delta between your environment and ours, and that should be easy to do, just may require a few pings back and forth.

Also it would help a lot if you were able to also test with the latest bleeding edge nightly
http://ci.liferay.org.es/jenkins/job/liferay-ide/1260/artifact/build/releng/com.liferay.ide-repository/target/updatesite/


Please use that in a brand new test environment, as there are still dragons in there and I don't want to break your stuff. So if you can setup a new Luna install and add that plugin and then try to replicate the bug. Grab the error message, post it here and then we can try to some things on our end (even add some tracing) and try to narrow down things.
thumbnail
Sergio Romero, modificado 9 Anos atrás.

RE: Error creating Liferay plugin project.

Regular Member Postagens: 151 Data de Entrada: 14/04/08 Postagens Recentes
Thanks Greg,

I will test it this afternoon and tell you the results.

Best regards.emoticon