Fórum

Error when trying to use ant

Alex Scotland, modificado 8 Anos atrás.

Error when trying to use ant

New Member Postagens: 22 Data de Entrada: 10/07/15 Postagens Recentes
When trying to run ant, I get this error:

[javac] 1. ERROR in /opt/liferay-plugins-sdk-6.2/webs/resources-importer-web/docroot/WEB-INF/src/com/liferay/resourcesimporter/util/PluginPackageProperties.java (at line 18)
[javac] import com.liferay.portal.kernel.util.PortalRunMode;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import com.liferay.portal.kernel.util.PortalRunMode cannot be resolved
[javac] ----------
[javac] 2. ERROR in /opt/liferay-plugins-sdk-6.2/webs/resources-importer-web/docroot/WEB-INF/src/com/liferay/resourcesimporter/util/PluginPackageProperties.java (at line 84)
[javac] PortalRunMode.isTestMode();
[javac] ^^^^^^^^^^^^^
[javac] PortalRunMode cannot be resolved
[javac] ----------
[javac] 2 problems (2 errors)
[antcall] Exiting /opt/liferay-plugins-sdk-6.2/build.xml.

We went and found the folders com and liferay, but the folder "portal" is missing.
Any idea of why we are getting this error? are we missing something crucial for this to work?
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: Error when trying to use ant

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Have you created your build.<username>.properties file and point it at a valid Liferay bundle?
Alex Scotland, modificado 8 Anos atrás.

RE: Error when trying to use ant

New Member Postagens: 22 Data de Entrada: 10/07/15 Postagens Recentes
I have indeed
thumbnail
Amos Fong, modificado 8 Anos atrás.

RE: Error when trying to use ant

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Looks like that class is should be in /shared/portal-compat-shared which all plugins should depend on. Can verify that's been compiled when you compile resource-importer?
thumbnail
Bijan Vakili, modificado 6 Anos atrás.

RE: Error when trying to use ant

Expert Postagens: 375 Data de Entrada: 10/03/09 Postagens Recentes
The issue's still here in SDK; more specific, 6.2 GA6; since PortalRunMode was not in that tag; and was introduced with version 7:
https://github.com/liferay/liferay-portal/commit/7f5a2d786744d823c49e1d3a9da3b34c6df62d38

git tag --contains 7f5a2d786744d823c49e1d3a9da3b34c6df62d38
7.0.0-a1
7.0.0-a2
7.0.0-a3
7.0.0-a4
7.0.0-a5
7.0.0-b1
7.0.0-b2
7.0.0-b3
7.0.0-b4
7.0.0-b5
7.0.0-b6
7.0.0-b7
7.0.0-ga1
7.0.0-m1
7.0.0-m2
7.0.0-m3
7.0.0-m4
7.0.0-m5
7.0.0-m6
7.0.0-m7
7.0.1-ga2
7.0.2-ga3
sync-3.0.0-b1
sync-3.0.1-b2
sync-3.0.10-ga2
sync-3.0.2-b3
sync-3.0.3-b4
sync-3.0.4-b5
sync-3.0.5-b6
sync-3.0.6-b7
sync-3.0.7-b8
sync-3.0.8-b9
sync-3.0.9-ga1
sync-3.1.0-ga1


Workaround is to just compile this class; and add to classpath as workaround.
Or otherwise update following file:
plugins/webs/resources-importer-web/docroot/WEB-INF/src/com/liferay/resourcesimporter/util/PluginPackageProperties.java
To remove all references to it.