掲示板

Maven plugin creation fails in Liferay Developer Studio 2.0 ga1

thumbnail
8年前 に Enrique Valdes Lacasa によって更新されました。

Maven plugin creation fails in Liferay Developer Studio 2.0 ga1

Junior Member 投稿: 92 参加年月日: 14/07/29 最新の投稿
Hello everyone,

I am trying to create a hook through the wizard: File->New->Liferay Plugin Project... but when I click on finish I get an error: Error creating Liferay plugin project. In the log, the following is displayed:

org.eclipse.core.runtime.CoreException: Could not resolve archetype com.liferay.maven.archetypes:liferay-hook-archetype:7.0.0-m2 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:233)
    at com.liferay.ide.project.core.NewLiferayProjectProvider.createNewProject(NewLiferayProjectProvider.java:45)
    at com.liferay.ide.project.core.model.NewLiferayPluginProjectOpMethods.execute(NewLiferayPluginProjectOpMethods.java:107)
    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-hook-archetype:jar:7.0.0-m2
    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:830)
    ... 15 more


It seems like Liferay Developer Studio IDE wants to run the Liferay 7.0.0-m2 archetype when creating the plugin. Also... I am not sure if the Liferay 7 archetype is the one I need, since I want to develop plugins for Liferay 6.2, but it looked like it doesn't matter. I looked into my local maven repository, and when I go to: .m2\repository\com\liferay\maven\archetypes, I can see there is a liferay-hook-artifact, which contains the 7.0.0-m2 hook archetype artifact... So I am not sure what the problem is.

Thanks a lot for any help!
thumbnail
8年前 に David H Nebinger によって更新されました。

RE: Maven plugin creation fails in Liferay Developer Studio 2.0 ga1

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
You don't have a profile defined in your settings.xml file...

So I have a profile defined in mine which specifies all of the basic Liferay values to use:

<profile>
<id>lr-62-cega4</id>

<properties>
<liferay.version>6.2.3</liferay.version>
<liferay.bundle.dir>/Users/dnebinger/liferay/62cega4/bundle</liferay.bundle.dir>
<liferay.auto.deploy.dir>${liferay.bundle.dir}/deploy</liferay.auto.deploy.dir>
<liferay.app.server.deploy.dir>${liferay.bundle.dir}/tomcat-7.0.42/webapps</liferay.app.server.deploy.dir>
<liferay.app.server.lib.global.dir>${liferay.bundle.dir}/tomcat-7.0.42/lib/ext</liferay.app.server.lib.global.dir>
<liferay.app.server.portal.dir>${liferay.app.server.deploy.dir}/ROOT</liferay.app.server.portal.dir>
</properties>
</profile>

Since I have this profile and since I declare it as active, Maven will use the 6.2 CE GA4 for all plugins.

However, if you don't have a profile defined Maven will often assume the latest and greatest available version which just happens to be 7.0.0 M2.

So this is not a Liferay issue nor an IDE issue, it's just an environmental issue...

Hope this helps!
thumbnail
8年前 に Enrique Valdes Lacasa によって更新されました。

RE: Maven plugin creation fails in Liferay Developer Studio 2.0 ga1

Junior Member 投稿: 92 参加年月日: 14/07/29 最新の投稿
Thanks a lot for answering David. I will try it out and post back the results.
8年前 に Nagaraju Uppalapati によって更新されました。

RE: Maven plugin creation fails in Liferay Developer Studio 2.0 ga1

New Member 投稿: 24 参加年月日: 15/06/29 最新の投稿
Hi David,

As you mentioned we added your code in settings.xml. But still i am receiving the same error.
Please suggest me how to fix it.
thumbnail
8年前 に David H Nebinger によって更新されました。

RE: Maven plugin creation fails in Liferay Developer Studio 2.0 ga1

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
Make sure you're editing the right settings.xml file (i.e. Eclipse sometimes uses a separate settings.xml file if you're not careful) and make sure you mark the profile as active (default). If you have no active profiles the ones listed aren't used.
8年前 に Nagaraju Uppalapati によって更新されました。

RE: Maven plugin creation fails in Liferay Developer Studio 2.0 ga1

New Member 投稿: 24 参加年月日: 15/06/29 最新の投稿
Hi David,

Thanks for the response. I modified right settings.xml and profile is active. But still receiving the same error message.

Please suggest me how to fix it.
thumbnail
8年前 に Yanan Yuan によって更新されました。

RE: Maven plugin creation fails in Liferay Developer Studio 2.0 ga1

Junior Member 投稿: 89 参加年月日: 11/10/08 最新の投稿
Hello Nagaraju ,

File->New->Liferay Plugin Project... but when I click on finish I get an error


Assuming that your default maven hook archetype has been set to 7.0.0-m2 by default.

To change that, go to Window -> Preferences -> Liferay -> Maven, where you can set all your archetypes for New Liferay Plugin Project Wizard, change your hook archetype to the following or the one you would like to use,

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

And then try to create again, now it should use 6.2.1 archetype. If you've downloaded the archetypes before, it should be fast, otherwise, it will need some time to download.

Hope that helps.
Best regards.