掲示板

2.0.0-M3: New Liferay Plugin Project with Maven Build fails

10年前 に Adam Crowther によって更新されました。

2.0.0-M3: New Liferay Plugin Project with Maven Build fails

New Member 投稿: 11 参加年月日: 13/12/19 最新の投稿
Good morning,

I am new to Liferay, so please forgive me if this is a noob question.

I followed the instructions in the 6.2 development guide, and got the SDK installed, and the IDE Plugins installed from an archive of the update site: liferay-ide-updatesite-2.0.0-m3-201311271605.zip

When I start the "New Liferay Plugin Project" and choose "Build type: Maven", plugin type "Portlet", and portlet framework "Liferay MVC", the wizard aborts the creation of the new project with the following error message: "Error creating Liferay plugin project. Please see Eclipse error log for more details." The Eclipse log shows the following line:

!ENTRY com.liferay.ide.maven.core 4 0 2013-12-19 08:45:06.228
!MESSAGE Unable to get latest Liferay archetype
!STACK 0
org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.liferay.maven.archetypes:liferay-portlet-archetype:jar:6.2.0-ga1 from/to central (http://repo1.maven.org/maven2/): repo1.maven.org


When I look in Maven Central I can't see the ga1 version - the last version that is there is 6.2.0-RC5. I can, however, see this version in the Liferay-CE Nexus, but I can't find a way to tell the wizard to use it instead of repo1.maven.org. I even tried removing ALL other repositories except for the Liferay-CE Nexus from my Maven settings.xml (and updating in Eclipse Preferences), but the wizard is still going to repo1.maven.org.

Is there a reason why the ga1 version has not been published to repo1.maven.org? How do I reconfigure the Wizard so it either uses the Liferay-CE nexus or the RC5 version?

Thanks very much for any hints or help you can give.

Yours,

Adam Crowther

PS The complete stacktrace from the Eclipse are attached

添付ファイル:

thumbnail
10年前 に Gregory Amerson によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

Liferay Legend 投稿: 1123 参加年月日: 10/02/16 最新の投稿
Hello Adam,

Can you try to reproduce your error with the latest RC build of 2.0.0? Here is the eclipse updatesite url:

http://files.liferay.org.es/staged/public-files/liferay-ide/unstable/build/releng/com.liferay.ide-repository/target/updatesite/

In the 2.0M3 version we had added the Liferay CE nexus into our resolution for what the latest archetype version was, but then the Eclipse maven plugin was not able to automatically search the Liferay CE nexus for the 6.2.0-ga1 archetypes. Now for 2.0.0 release of IDE we will just be using maven central to resolve the latest available Liferay maven plugin archetypes. So it should work for you. Of course you could modify your user settings.xml to add the Liferay CE nexus and then the new liferay project wizard should find the latest version.

To answer your other question as "why haven't 6.2.0-ga1 artifacts been published into maven central?" I don't have a good answer for that as I don't know the reasons myself but I will try to find out.
10年前 に Adam Crowther によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

New Member 投稿: 11 参加年月日: 13/12/19 最新の投稿
Hi Gregory,

Thanks very much for the quick reply.

I installed 2.0.0-ga1 and tried again, with the same result:

!ENTRY com.liferay.ide.maven.core 4 0 2013-12-19 10:54:00.279
!MESSAGE Unable to get latest Liferay archetype
!STACK 0
org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.liferay.maven.archetypes:liferay-portlet-archetype:jar:6.2.0-ga1 from/to central (http://repo1.maven.org/maven2/): repo1.maven.org


My settings.xml file contains the following repositories:

<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>liferay</id>
<name>Liferay Nexus</name>
<url>https://repository.liferay.com/nexus/content/groups/liferay-ce</url>
</repository>
<repository>
<id>repo1</id>
<name>libs-repo1</name>
<url>http://zrh-s612.vt.ch/artifactory/remote_repos</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://zrh-s612.vt.ch/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://zrh-s612.vt.ch/artifactory/libs-snapshot</url>
</repository>
</repositories>

That seems to work, because if I add a dependency to an existing project it downloads fine, and I can see 6.2.0-ga1 in my local repository:
Edit: replaced the wrong directory here.
W:\.m2\repository\com\liferay\maven\archetypes\liferay-portlet-archetype\6.2.0-ga1


So it doesn't seem to be a local configuration problem, but still the wizard fails with the error message above and the attached stacktrace.

Incidentally, I can't add your nexus to our artifactory as a remote repository - it's telling me it can't resolve the host name. That's why I had to add it to my local settings.xml. I don't think it's not a firewall issue because the URL resolves and loads fine in a browser on the same machine. I'm guessing our artefactory can't handle some speciality of your dns entry or your server setup... is it redirecting to another site?

Thanks again for your support - I look forward to a reply.

Yours,

Adam

添付ファイル:

thumbnail
10年前 に Gregory Amerson によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

Liferay Legend 投稿: 1123 参加年月日: 10/02/16 最新の投稿
Hey Adam,

I see in our code we still had one place where we were defaulting to 6.2.0-ga1 if it couldn't read from remote. This default should be switched to 6.2.0-RC5 since it is the latest available archetype on central. I'll make that change and create a new RC build and send your way. The IDE dev team is rebuilding one as we speak to fix some other fixes. I'll update this thread once I have the new build.
thumbnail
10年前 に Gregory Amerson によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

Liferay Legend 投稿: 1123 参加年月日: 10/02/16 最新の投稿
FYI here is the ticket covering this issue: https://issues.liferay.com/browse/IDE-1347
thumbnail
10年前 に Gregory Amerson によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails (回答)

Liferay Legend 投稿: 1123 参加年月日: 10/02/16 最新の投稿
10年前 に Adam Crowther によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

New Member 投稿: 11 参加年月日: 13/12/19 最新の投稿
Hiya,

I tried that and it the result was better. Maven now finds and downloads the artifcats correctly, but fails later down the line with the following error message in the log:


!ENTRY com.liferay.ide.project.core 4 0 2013-12-19 14:04:58.180
!MESSAGE Error creating Liferay plugin project.
!STACK 1
org.eclipse.core.runtime.CoreException: Could not calculate build plan: Plugin com.liferay.maven.plugins:liferay-maven-plugin:${liferay.maven.plugin.version} or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.liferay.maven.plugins:liferay-maven-plugin:jar:${liferay.maven.plugin.version}


I am now playing with the pom file that it generates, so see if I can get something working.

Thanks again for your assistance.

Yours,

Adam

PS: The full stacktrace is here:

添付ファイル:

10年前 に Adam Crowther によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

New Member 投稿: 11 参加年月日: 13/12/19 最新の投稿
OK so after a bit of massaging it looks like I have something I can continue with.

I had to switch the deployment descriptor to version 2.5 of the web-app spec, and I had to add a series of properties to the generated pom file:


	<properties>
		<liferay.app.server.lib.global.dir>C:\liferay-6.2\jboss-7.1.1\standalone\lib\ext</liferay.app.server.lib.global.dir>
		<liferay.app.server.deploy.dir>C:\liferay-6.2\jboss-7.1.1\standalone\deployments</liferay.app.server.deploy.dir>
		<liferay.app.server.portal.dir>C:\liferay-6.2\jboss-7.1.1\standalone\deployments\ROOT.war</liferay.app.server.portal.dir>
		<liferay.auto.deploy.dir>C:\liferay-6.2\deploy</liferay.auto.deploy.dir>
		<liferay.maven.plugin.version>6.2.0-RC5</liferay.maven.plugin.version>
		<liferay.version>6.2.0-RC5</liferay.version>
	</properties>


I then ran Maven => Update Project, and the compile problems and warnings went away. Very cool, now I can start with a hello world, and take it from there.

I'm not sure that I am specifying the correct directories though - the root is correct, but I am specifically unsure of 'deployments' and 'deployments\ROOT.war'. Are these the correct values or have I got it wrong? (I haven't tried a deployment yet, would just like to know if it looks plausible).

Thanks,

Adam
thumbnail
10年前 に Gregory Amerson によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails (回答)

Liferay Legend 投稿: 1123 参加年月日: 10/02/16 最新の投稿
Adam Crowther:
OK so after a bit of massaging it looks like I have something I can continue with.

I had to switch the deployment descriptor to version 2.5 of the web-app spec, and I had to add a series of properties to the generated pom file:


	<properties>
		<liferay.app.server.lib.global.dir>C:\liferay-6.2\jboss-7.1.1\standalone\lib\ext</liferay.app.server.lib.global.dir>
		<liferay.app.server.deploy.dir>C:\liferay-6.2\jboss-7.1.1\standalone\deployments</liferay.app.server.deploy.dir>
		<liferay.app.server.portal.dir>C:\liferay-6.2\jboss-7.1.1\standalone\deployments\ROOT.war</liferay.app.server.portal.dir>
		<liferay.auto.deploy.dir>C:\liferay-6.2\deploy</liferay.auto.deploy.dir>
		<liferay.maven.plugin.version>6.2.0-RC5</liferay.maven.plugin.version>
		<liferay.version>6.2.0-RC5</liferay.version>
	</properties>


I then ran Maven => Update Project, and the compile problems and warnings went away. Very cool, now I can start with a hello world, and take it from there.

I'm not sure that I am specifying the correct directories though - the root is correct, but I am specifically unsure of 'deployments' and 'deployments\ROOT.war'. Are these the correct values or have I got it wrong? (I haven't tried a deployment yet, would just like to know if it looks plausible).

Thanks,

Adam



Glad to hear the archetype downloading worked this time! Also the other failure is expected if you didn't already have a profile setup that would point to you Liferay bundle.

You see most Liferay maven developers already have those 'profile' settings defined in a parent pom or in a settings.xml profile and they are ready to go from the first moment of creation of the project. So what I would do is take those <properties> that you defined and move them out to your ${user.dir}/.m2/settings.xml file In that file you can add a <profiles></profiles> section and you can create a new profile called 'liferay-jboss-6.2.0' or whatever. And then in Eclipse you can right click your project and go to project properties > maven and select active profiles, and just type in that profile value and all the errors will go away.

Sorry you have had to navigate your way through all this unguided. Our great documentation team is hard at work now putting together some documentation to go along with the new maven support in Liferay IDE 2.0.
thumbnail
10年前 に Abhed Dekavadiya によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

Junior Member 投稿: 74 参加年月日: 10/10/05 最新の投稿
Hello Gregory,

Do you have idea on approximate publish date for LR-ce-6.2 maven dependencies on central repository ?

Kind Regards,
Abhed Dekavadiya
thumbnail
10年前 に Gregory Amerson によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

Liferay Legend 投稿: 1123 参加年月日: 10/02/16 最新の投稿
No word yet.
thumbnail
8年前 に Enrique Valdes Lacasa によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

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

I am currently facing a similar issue in Liferay Developer Studio. I am trying to create a hook through the wizard, 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 is trying to run the Liferay 7.0.0-m2 archetype...but I need to get the 6.2.x one, to develop plugins for Liferay 6.2. I am not sure why it is doing this and if this is a Maven local config problem, or something to be set in LDS IDE.

Any help would be appreciated! Thank you!
thumbnail
8年前 に David H Nebinger によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
This is a two year old thread on an old version of the IDE (probably not the one you're using).

You should open a new thread on this instead.
thumbnail
8年前 に Enrique Valdes Lacasa によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

Junior Member 投稿: 92 参加年月日: 14/07/29 最新の投稿
Thank you for the heads up David, I will.
thumbnail
8年前 に Enrique Valdes Lacasa によって更新されました。

RE: 2.0.0-M3: New Liferay Plugin Project with Maven Build fails

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