Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Ian Harrigan
Liferay 6.1 & maven service builder
27 de Janeiro de 2012 03:37
Resposta

Ian Harrigan

Ranking: New Member

Mensagens: 19

Data de entrada: 22 de Novembro de 2011

Mensagens recentes

Hi All,

I am having a problem trying to build a portlets service via maven in liferay 6.1.0. All of this previously worked (and continues to) under 6.0.6. I first installed the maven artifacts via the supplied ant script in 6.1.0 - all fine so far.

I then created a portlet and built it via "mvn install" - also, all ok so far.

However, after creating a basic service.xml and running "mvn liferay:build-service", i get the following:

Scanning for projects...
------------------------------------------------------------------------
Building MMC Audit Trail Portlets
task-segment: [liferay:build-service]
------------------------------------------------------------------------
[liferay:build-service {execution: default-cli}]
Building from X:\liferay-portal-6.1.0-mmc\liferay-plugins-sdk-6.1.0\portlets\mmc\audit-trail-bundle/src/main/webapp/WEB-INF/service.xml
27-Jan-2012 12:09:31 com.liferay.portal.kernel.log.Jdk14LogImpl info
INFO: No server detected
Loading jar:file:/C:/Users/ihar/.m2/repository/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.jar!/system.properties
27-Jan-2012 12:09:31 com.liferay.portal.kernel.log.Jdk14LogImpl info
INFO: Global lib directory /C:/Users/ihar/.m2/repository/com/liferay/portal/portal-service/6.1.0/
27-Jan-2012 12:09:31 com.liferay.portal.kernel.log.Jdk14LogImpl info
INFO: Portal lib directory /C:/Users/ihar/.m2/repository/com/liferay/portal/util-java/6.1.0/util-java-6.1.0.jar!/
SLF4J: The requested version 1.6.4 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/ihar/.m2/repository/com/liferay/portal/util-java/6.1.0/util-java-6.1.0.jar!/org/slf4j/impl/StaticLoggerBin
der.class]
SLF4J: Found binding in [jar:file:/C:/Users/ihar/.m2/repository/org/slf4j/slf4j-log4j12/1.5.11/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/StaticLoggerBi
nder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[FATAL ERROR] com.liferay.maven.plugins.ServiceBuilderMojo#execute() caused a linkage error (java.lang.AbstractMethodError) and may be out-of-date. Ch
eck the realms:
[FATAL ERROR] Plugin realm = app0.child-container[com.liferay.maven.plugins:liferay-maven-plugin:6.1.0]
urls[0] = file:/C:/Users/ihar/.m2/repository/com/liferay/maven/plugins/liferay-maven-plugin/6.1.0/liferay-maven-plugin-6.1.0.jar
urls[1] = file:/C:/Users/ihar/.m2/repository/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.jar
urls[2] = file:/C:/Users/ihar/.m2/repository/com/liferay/portal/portal-service/6.1.0/portal-service-6.1.0.jar
urls[3] = file:/C:/Users/ihar/.m2/repository/com/liferay/portal/util-bridges/6.1.0/util-bridges-6.1.0.jar
urls[4] = file:/C:/Users/ihar/.m2/repository/com/liferay/portal/util-java/6.1.0/util-java-6.1.0.jar
urls[5] = file:/C:/Users/ihar/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[6] = file:/C:/Users/ihar/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[7] = file:/C:/Users/ihar/.m2/repository/org/apache/maven/shared/maven-invoker/2.0.10/maven-invoker-2.0.10.jar
urls[8] = file:/C:/Users/ihar/.m2/repository/com/sun/media/jai-codec/1.1.3/jai-codec-1.1.3.jar
urls[9] = file:/C:/Users/ihar/.m2/repository/javax/media/jai-core/1.1.3/jai-core-1.1.3.jar
urls[10] = file:/C:/Users/ihar/.m2/repository/com/thoughtworks/qdox/qdox/1.12/qdox-1.12.jar
urls[11] = file:/C:/Users/ihar/.m2/repository/commons-discovery/commons-discovery/0.4/commons-discovery-0.4.jar
urls[12] = file:/C:/Users/ihar/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar
urls[13] = file:/C:/Users/ihar/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
urls[14] = file:/C:/Users/ihar/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar
urls[15] = file:/C:/Users/ihar/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4.jar
urls[16] = file:/C:/Users/ihar/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
urls[17] = file:/C:/Users/ihar/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
urls[18] = file:/C:/Users/ihar/.m2/repository/easyconf/easyconf/0.9.5/easyconf-0.9.5.jar
urls[19] = file:/C:/Users/ihar/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar
urls[20] = file:/C:/Users/ihar/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
urls[21] = file:/C:/Users/ihar/.m2/repository/commons-configuration/commons-configuration/1.1/commons-configuration-1.1.jar
urls[22] = file:/C:/Users/ihar/.m2/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar
urls[23] = file:/C:/Users/ihar/.m2/repository/commons-lang/commons-lang/2.0/commons-lang-2.0.jar
urls[24] = file:/C:/Users/ihar/.m2/repository/commons-digester/commons-digester/1.6/commons-digester-1.6.jar
urls[25] = file:/C:/Users/ihar/.m2/repository/commons-beanutils/commons-beanutils/1.6/commons-beanutils-1.6.jar
urls[26] = file:/C:/Users/ihar/.m2/repository/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar
urls[27] = file:/C:/Users/ihar/.m2/repository/commons-beanutils/commons-beanutils-bean-collections/1.7.0/commons-beanutils-bean-collections-1.7.0.jar
urls[28] = file:/C:/Users/ihar/.m2/repository/xerces/xercesImpl/2.2.1/xercesImpl-2.2.1.jar
urls[29] = file:/C:/Users/ihar/.m2/repository/mx4j/mx4j-jmx/2.1.1/mx4j-jmx-2.1.1.jar
urls[30] = file:/C:/Users/ihar/.m2/repository/mx4j/mx4j-impl/2.1.1/mx4j-impl-2.1.1.jar
urls[31] = file:/C:/Users/ihar/.m2/repository/xstream/xstream/1.1.2/xstream-1.1.2.jar
urls[32] = file:/C:/Users/ihar/.m2/repository/jalopy/jalopy/1.5rc3/jalopy-1.5rc3.jar
urls[33] = file:/C:/Users/ihar/.m2/repository/javax/portlet/portlet-api/2.0/portlet-api-2.0.jar
urls[34] = file:/C:/Users/ihar/.m2/repository/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar
urls[35] = file:/C:/Users/ihar/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar
urls[36] = file:/C:/Users/ihar/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
urls[37] = file:/C:/Users/ihar/.m2/repository/javax/jms/jms/1.1/jms-1.1.jar
urls[38] = file:/C:/Users/ihar/.m2/repository/net/java/dev/rome/rome/1.0.0/rome-1.0.0.jar
urls[39] = file:/C:/Users/ihar/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar
urls[40] = file:/C:/Users/ihar/.m2/repository/org/apache/ant/ant/1.8.2/ant-1.8.2.jar
urls[41] = file:/C:/Users/ihar/.m2/repository/org/apache/ant/ant-launcher/1.8.2/ant-launcher-1.8.2.jar
urls[42] = file:/C:/Users/ihar/.m2/repository/org/apache/axis/axis/1.4/axis-1.4.jar
urls[43] = file:/C:/Users/ihar/.m2/repository/org/apache/axis/axis-ant/1.4/axis-ant-1.4.jar
urls[44] = file:/C:/Users/ihar/.m2/repository/org/apache/axis/axis-jaxrpc/1.4/axis-jaxrpc-1.4.jar
urls[45] = file:/C:/Users/ihar/.m2/repository/org/apache/jackrabbit/jackrabbit-core/2.1.2/jackrabbit-core-2.1.2.jar
urls[46] = file:/C:/Users/ihar/.m2/repository/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar
urls[47] = file:/C:/Users/ihar/.m2/repository/commons-dbcp/commons-dbcp/1.2.2/commons-dbcp-1.2.2.jar
urls[48] = file:/C:/Users/ihar/.m2/repository/commons-pool/commons-pool/1.3/commons-pool-1.3.jar
urls[49] = file:/C:/Users/ihar/.m2/repository/org/apache/jackrabbit/jackrabbit-api/2.1.2/jackrabbit-api-2.1.2.jar
urls[50] = file:/C:/Users/ihar/.m2/repository/org/apache/jackrabbit/jackrabbit-jcr-commons/2.1.2/jackrabbit-jcr-commons-2.1.2.jar
urls[51] = file:/C:/Users/ihar/.m2/repository/org/apache/jackrabbit/jackrabbit-spi-commons/2.1.2/jackrabbit-spi-commons-2.1.2.jar
urls[52] = file:/C:/Users/ihar/.m2/repository/org/apache/jackrabbit/jackrabbit-spi/2.1.2/jackrabbit-spi-2.1.2.jar
urls[53] = file:/C:/Users/ihar/.m2/repository/org/slf4j/slf4j-api/1.5.11/slf4j-api-1.5.11.jar
urls[54] = file:/C:/Users/ihar/.m2/repository/org/apache/tika/tika-parsers/0.6/tika-parsers-0.6.jar
urls[55] = file:/C:/Users/ihar/.m2/repository/org/apache/tika/tika-core/0.8/tika-core-0.8.jar
urls[56] = file:/C:/Users/ihar/.m2/repository/org/apache/commons/commons-compress/1.0/commons-compress-1.0.jar
urls[57] = file:/C:/Users/ihar/.m2/repository/org/apache/pdfbox/pdfbox/1.0.0/pdfbox-1.0.0.jar
urls[58] = file:/C:/Users/ihar/.m2/repository/org/apache/pdfbox/fontbox/1.0.0/fontbox-1.0.0.jar
urls[59] = file:/C:/Users/ihar/.m2/repository/org/apache/pdfbox/jempbox/1.0.0/jempbox-1.0.0.jar
urls[60] = file:/C:/Users/ihar/.m2/repository/org/apache/poi/poi/3.6/poi-3.6.jar
urls[61] = file:/C:/Users/ihar/.m2/repository/org/apache/poi/poi-scratchpad/3.6/poi-scratchpad-3.6.jar
urls[62] = file:/C:/Users/ihar/.m2/repository/org/apache/poi/poi-ooxml/3.6/poi-ooxml-3.6.jar
urls[63] = file:/C:/Users/ihar/.m2/repository/org/apache/poi/poi-ooxml-schemas/3.6/poi-ooxml-schemas-3.6.jar
urls[64] = file:/C:/Users/ihar/.m2/repository/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar
urls[65] = file:/C:/Users/ihar/.m2/repository/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar
urls[66] = file:/C:/Users/ihar/.m2/repository/org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar
urls[67] = file:/C:/Users/ihar/.m2/repository/asm/asm/3.1/asm-3.1.jar
urls[68] = file:/C:/Users/ihar/.m2/repository/com/drewnoakes/metadata-extractor/2.4.0-beta-1/metadata-extractor-2.4.0-beta-1.jar
urls[69] = file:/C:/Users/ihar/.m2/repository/org/slf4j/jcl-over-slf4j/1.5.8/jcl-over-slf4j-1.5.8.jar
urls[70] = file:/C:/Users/ihar/.m2/repository/org/apache/lucene/lucene-core/2.4.1/lucene-core-2.4.1.jar
urls[71] = file:/C:/Users/ihar/.m2/repository/org/apache/derby/derby/10.5.3.0_1/derby-10.5.3.0_1.jar
urls[72] = file:/C:/Users/ihar/.m2/repository/org/apache/tomcat/tomcat-jdbc/7.0.22/tomcat-jdbc-7.0.22.jar
urls[73] = file:/C:/Users/ihar/.m2/repository/org/apache/tomcat/tomcat-juli/7.0.22/tomcat-juli-7.0.22.jar
urls[74] = file:/C:/Users/ihar/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
urls[75] = file:/C:/Users/ihar/.m2/repository/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
urls[76] = file:/C:/Users/ihar/.m2/repository/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar
urls[77] = file:/C:/Users/ihar/.m2/repository/org/slf4j/slf4j-log4j12/1.5.11/slf4j-log4j12-1.5.11.jar
urls[78] = file:/C:/Users/ihar/.m2/repository/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar
urls[79] = file:/C:/Users/ihar/.m2/repository/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar
urls[80] = file:/C:/Users/ihar/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
urls[81] = file:/C:/Users/ihar/.m2/repository/org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE.jar
urls[82] = file:/C:/Users/ihar/.m2/repository/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE.jar
urls[83] = file:/C:/Users/ihar/.m2/repository/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar
urls[84] = file:/C:/Users/ihar/.m2/repository/org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE.jar
urls[85] = file:/C:/Users/ihar/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
urls[86] = file:/C:/Users/ihar/.m2/repository/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar
urls[87] = file:/C:/Users/ihar/.m2/repository/rome/rome/1.0/rome-1.0.jar
urls[88] = file:/X:/liferay-portal-6.1.0-mmc/liferay-plugins-sdk-6.1.0/portlets/mmc/audit-trail-bundle/target/classes/
[FATAL ERROR] Container realm = plexus.core
urls[0] = file:/C:/Tools/apache-maven-2.2.1/bin/../lib/maven-2.2.1-uber.jar
------------------------------------------------------------------------
FATAL ERROR
------------------------------------------------------------------------
com.liferay.util.sl4fj.LiferayLoggerAdapter.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
------------------------------------------------------------------------
Trace
java.lang.AbstractMethodError: com.liferay.util.sl4fj.LiferayLoggerAdapter.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throw
able;)V
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
at com.germinus.easyconf.EasyConf.refreshAll(EasyConf.java:122)
at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:89)
at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:67)
at com.liferay.portal.util.PropsUtil.<init>(PropsUtil.java:164)
at com.liferay.portal.util.PropsUtil.<clinit>(PropsUtil.java:323)
at com.liferay.maven.plugins.ServiceBuilderMojo.doExecute(ServiceBuilderMojo.java:95)
at com.liferay.maven.plugins.ServiceBuilderMojo.execute(ServiceBuilderMojo.java:59)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
------------------------------------------------------------------------
Total time: 4 seconds
Finished at: Fri Jan 27 12:09:31 CET 2012
Final Memory: 12M/29M
------------------------------------------------------------------------

It appears to just be a build issue, seems to be some sort of version mismatch in logging systems (?). Regardless, if anyone could help me it would be greatly appreciated as we would really like to leverage the enhancements in 6.1.0.

Thanks in advance,
Ian Harrigan
Tom Vleminckx
RE: Liferay 6.1 & maven service builder
27 de Janeiro de 2012 04:46
Resposta

Tom Vleminckx

Ranking: Junior Member

Mensagens: 39

Data de entrada: 27 de Junho de 2011

Mensagens recentes

I have the same problem....anyone ?
Ian Harrigan
RE: Liferay 6.1 & maven service builder
27 de Janeiro de 2012 06:14
Resposta

Ian Harrigan

Ranking: New Member

Mensagens: 19

Data de entrada: 22 de Novembro de 2011

Mensagens recentes

Also happens with maven3...

Ian
Tom Vleminckx
RE: Liferay 6.1 & maven service builder
27 de Janeiro de 2012 06:36
Resposta

Tom Vleminckx

Ranking: Junior Member

Mensagens: 39

Data de entrada: 27 de Junho de 2011

Mensagens recentes

There is a problem with the slf4j binding used in the util-java package dependency.

I also tried the 6.2.0 version of the maven plugin and same issue...
Ian Harrigan
RE: Liferay 6.1 & maven service builder
27 de Janeiro de 2012 06:42
Resposta

Ian Harrigan

Ranking: New Member

Mensagens: 19

Data de entrada: 22 de Novembro de 2011

Mensagens recentes

Is there anyway to override (or remove) this binding without breaking the build?

Ian
Ian Harrigan
RE: Liferay 6.1 & maven service builder
27 de Janeiro de 2012 08:55
Resposta

Ian Harrigan

Ranking: New Member

Mensagens: 19

Data de entrada: 22 de Novembro de 2011

Mensagens recentes

Ok,

I have managed to hack together a work around that will generate the service builder .java files via ant and simply copy them over to the correct maven directories. This means instead of a "liferay:build-service", you simply call an ant task to generate the source files. You will have to play with the ant project file to make sure the directories match your own, but apart from that it shouldnt matter where you build this from (it can, of course, be included as part of you maven build).

Ian

 1
 2
 3<?xml version="1.0"?>
 4<!DOCTYPE project>
 5
 6<project name="build-service" basedir="." default="build-service">
 7    <property name="dir.sdk" value="X:/liferay-portal-6.1.0-mmc/liferay-plugins-sdk-6.1.0"/>
 8    <property name="dir.tomcat" value="X:/liferay-portal-6.1.0-mmc/tomcat-7.0.23"/>
 9
10
11    <property name="dir.temp" value="${basedir}/temp"/>
12    <property name="dir.java" value="${dir.temp}/src/main/java"/>
13    <property name="dir.webapp" value="${dir.temp}/src/main/webapp"/>
14    <property name="dir.res" value="${dir.temp}/src/main/resources"/>
15    <property name="dir.res.service" value="${dir.temp}/src/main/resources/META-INF"/>
16   
17    <property name="service.input.file" value="${basedir}/src/main/webapp/WEB-INF/service.xml"/>
18   
19    <target name="build-service">
20        <mkdir dir="${dir.temp}" />
21        <mkdir dir="${dir.webapp}/WEB-INF/sql" />
22
23        <path id="portal.classpath">
24            <fileset dir="${dir.sdk}/lib" includes="*.jar" />
25            <fileset dir="${dir.tomcat}/lib/ext" includes="*.jar" />
26            <fileset dir="${dir.tomcat}/webapps/ROOT/WEB-INF/lib" includes="*.jar" />
27        </path>
28   
29        <path id="service.classpath">
30            <path refid="portal.classpath" />
31        </path>
32
33        <java
34            classname="com.liferay.portal.tools.servicebuilder.ServiceBuilder"
35            classpathref="service.classpath"
36            outputproperty="service.test.output"
37        >
38            <arg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
39            <arg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger" />
40            <arg value="service.input.file=${service.input.file}" />
41            
42            <arg value="service.hbm.file=${dir.res.service}/portlet-hbm.xml" />
43            <arg value="service.orm.file=${dir.res.service}/portlet-orm.xml" />
44            <arg value="service.model.hints.file=${dir.res.service}/portlet-model-hints.xml" />
45            <arg value="service.spring.file=${dir.res.service}/portlet-spring.xml" />
46            <arg value="service.spring.base.file=${dir.res.service}/base-spring.xml" />
47            <arg value="service.spring.cluster.file=${dir.res.service}/cluster-spring.xml" />
48            <arg value="service.spring.dynamic.data.source.file=${dir.res.service}/dynamic-data-source-spring.xml" />
49            <arg value="service.spring.hibernate.file=${dir.res.service}/hibernate-spring.xml" />
50            <arg value="service.spring.infrastructure.file=${dir.res.service}/infrastructure-spring.xml" />
51            <arg value="service.spring.shard.data.source.file=${dir.res.service}/shard-data-source-spring.xml" />
52
53            <arg value="service.api.dir=${dir.java}" />
54
55            <arg value="service.impl.dir=${dir.java}" />
56            <arg value="service.sql.dir=${dir.webapp}/WEB-INF/sql" />
57            <arg value="service.sql.file=tables.sql" />
58            <arg value="service.sql.indexes.file=indexes.sql" />
59            <arg value="service.sql.indexes.properties.file=indexes.properties" />
60            <arg value="service.sql.sequences.file=sequences.sql" />
61            <arg value="service.auto.namespace.tables=true" />
62            
63            <arg value="service.bean.locator.util=com.liferay.util.bean.PortletBeanLocatorUtil" />
64
65            <arg value="service.props.util=com.liferay.util.service.ServiceProps" />
66
67            <arg value="service.plugin.name=${plugin.name}" />
68        </java>
69
70        <echo>${service.test.output}</echo>
71       
72        <copy toDir="${basedir}">
73            <fileset dir="${dir.temp}">
74                <include name="**/*.*"/>
75            </fileset>
76        </copy>
77    </target>
78</project>
Tom Vleminckx
RE: Liferay 6.1 & maven service builder
1 de Fevereiro de 2012 00:00
Resposta

Tom Vleminckx

Ranking: Junior Member

Mensagens: 39

Data de entrada: 27 de Junho de 2011

Mensagens recentes

Thanks, this confirms that there is something wrong with the util-java maven artifact.

Should be nice if this works...
Mika Koivisto
RE: Liferay 6.1 & maven service builder
1 de Fevereiro de 2012 14:19
Resposta

Mika Koivisto

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1505

Data de entrada: 7 de Agosto de 2006

Mensagens recentes

We had made changes to logging and now we have our own slf4j adapter in util-java. That unfortunately didn't work with the one defined for liferay-maven-plugin. There's and http://issues.liferay.com/browse/MAVEN-4 and I've submitted a fix for it https://github.com/brianchandotcom/liferay-maven-support/pull/10.
Tom Vleminckx
RE: Liferay 6.1 & maven service builder
2 de Fevereiro de 2012 00:23
Resposta

Tom Vleminckx

Ranking: Junior Member

Mensagens: 39

Data de entrada: 27 de Junho de 2011

Mensagens recentes

Super emoticon Thank you
Kamesh Sampath
RE: Liferay 6.1 & maven service builder
8 de Fevereiro de 2012 23:07
Resposta

Kamesh Sampath

Ranking: Regular Member

Mensagens: 159

Data de entrada: 26 de Maio de 2010

Mensagens recentes

Mika Koivisto:
We had made changes to logging and now we have our own slf4j adapter in util-java. That unfortunately didn't work with the one defined for liferay-maven-plugin. There's and http://issues.liferay.com/browse/MAVEN-4 and I've submitted a fix for it https://github.com/brianchandotcom/liferay-maven-support/pull/10.


Hi Mika,

Don't you think that we need two properties,

1.liferay.version = actual liferay portal version
2.liferay.maven.plugin.version=the liferay-maven-support version

This will give some clarity for the Maven users on the property, as of now liferay.version is very confusing.

your thoughts ?
Mika Koivisto
RE: Liferay 6.1 & maven service builder
9 de Fevereiro de 2012 10:08
Resposta

Mika Koivisto

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1505

Data de entrada: 7 de Agosto de 2006

Mensagens recentes

The maven plugin is tied to particular Liferay version and release cycle so that's why I just had one property.
Ian Harrigan
RE: Liferay 6.1 & maven service builder
21 de Fevereiro de 2012 08:01
Resposta

Ian Harrigan

Ranking: New Member

Mensagens: 19

Data de entrada: 22 de Novembro de 2011

Mensagens recentes

Hi again,

i have now managed to patch my .m2 repository in order to get past the logging problem. However, now when i run the build-service via maven i get the following:

 1[INFO] Scanning for projects...
 2[INFO]
 3[INFO] ------------------------------------------------------------------------
 4[INFO] Building Healthcare Gateway Portlets 1.0
 5[INFO] ------------------------------------------------------------------------
 6[INFO]
 7[INFO] --- liferay-maven-plugin:6.1.0:build-service (default-cli) @ hcgw-portlets ---
 8[INFO] Building from X:\liferay-portal-6.1.0-hcgw\HCGWProject\hcgw-portlets/src/main/webapp/WEB-INF/service.xml
 921-Feb-2012 16:58:02 com.liferay.portal.kernel.log.Jdk14LogImpl info
10INFO: No server detected
11Loading jar:file:/C:/Users/ihar/.m2/repository/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.jar!/system.properties
1221-Feb-2012 16:58:02 com.liferay.portal.kernel.log.Jdk14LogImpl info
13INFO: Global lib directory /C:/Users/ihar/.m2/repository/com/liferay/portal/portal-service/6.1.0/
1421-Feb-2012 16:58:02 com.liferay.portal.kernel.log.Jdk14LogImpl info
15INFO: Portal lib directory /C:/Users/ihar/.m2/repository/com/liferay/portal/util-java/6.1.0/util-java-6.1.0.jar!/
16- Refreshed the configuration of all components
17- Properties for jar:file:/C:/Users/ihar/.m2/repository/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.jar!/portal loaded from [jar:file:/C:/U
18sers/ihar/.m2/repository/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.jar!/portal.properties]
19Loading jar:file:/C:/Users/ihar/.m2/repository/com/liferay/portal/portal-impl/6.1.0/portal-impl-6.1.0.jar!/portal.properties
20Building AuditActionItem
21Writing null\urn\inps\hcgw\data\service\persistence\AuditActionItemPersistence.java
22Writing null\urn\inps\hcgw\data\service\persistence\AuditActionItemUtil.java
23Writing null\urn\inps\hcgw\data\model\AuditActionItemModel.java
24Writing null\urn\inps\hcgw\data\model\AuditActionItem.java
25Writing null\urn\inps\hcgw\data\model\AuditActionItemClp.java
26java.lang.NullPointerException
27        at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getJavaClass(ServiceBuilder.java:4221)
28        at com.liferay.portal.tools.servicebuilder.ServiceBuilder._createModelWrapper(ServiceBuilder.java:2242)
29        at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:670)
30        at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:430)
31        at com.liferay.maven.plugins.ServiceBuilderMojo.doExecute(ServiceBuilderMojo.java:119)
32        at com.liferay.maven.plugins.ServiceBuilderMojo.execute(ServiceBuilderMojo.java:59)
33        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
34        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:195)
35        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
36        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:140)
37        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
38        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
39        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
40        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
41        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:316)
42        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
43        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:451)
44        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:188)
45        at org.apache.maven.cli.MavenCli.main(MavenCli.java:134)
46        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
47        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
48        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
49        at java.lang.reflect.Method.invoke(Method.java:597)
50        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
51        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
52        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
53        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
54[INFO] ------------------------------------------------------------------------
55[INFO] BUILD SUCCESS
56[INFO] ------------------------------------------------------------------------
57[INFO] Total time: 2.661s
58[INFO] Finished at: Tue Feb 21 16:58:04 CET 2012
59[INFO] Final Memory: 12M/28M
60[INFO] ------------------------------------------------------------------------


The issue is that it keeps writing the output files to "null" and then just bombs out. Has anyone managed to get this to work? Any chance of taking a look at a working pom.xml?

Thanks in advance,
Ian
Kamesh Sampath
RE: Liferay 6.1 & maven service builder
1 de Março de 2012 06:32
Resposta

Kamesh Sampath

Ranking: Regular Member

Mensagens: 159

Data de entrada: 26 de Maio de 2010

Mensagens recentes

Can you please post your service.xml and your current pom.xml ?

I see it more than a namespace and package related problem rather than something do with liferay-maven-support.
Ian Harrigan
RE: Liferay 6.1 & maven service builder
1 de Março de 2012 09:25
Resposta

Ian Harrigan

Ranking: New Member

Mensagens: 19

Data de entrada: 22 de Novembro de 2011

Mensagens recentes

Hi thanks for the reply.

Heres the info you requested:

Service.xml
 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
 3
 4<service-builder package-path="urn.inps.hcgw.data">
 5    <namespace>HCGWData</namespace>
 6    <entity name="AuditItem" table="HCGW_AUDIT_ITEM" local-service="true" remote-service="false">
 7        <column name="Identity" type="long" primary="true"></column>
 8        <column name="DateTime" type="Date"></column>
 9        <column name="UserID" type="String"></column>
10        <column name="PatientID" type="String"></column>
11        <column name="ActionID" type="String"></column>
12        <column name="Success" type="long"></column>
13        <column name="ErrorCategory" type="String"></column>
14        <column name="ErrorText" type="String"></column>
15        <column name="ErrorDescription" type="String"></column>
16    </entity>
17    <entity name="AuditActionItem" table="HCGW_AUDIT_ACTION" local-service="true" remote-service="false">
18        <column name="ActionID" type="String" primary="true"></column>
19        <column name="ActionText" type="String"></column>
20        <column name="ActionDescription" type="String"></column>
21    </entity>
22    <entity name="AuditDetailItem" table="HCGW_AUDIT_DETAIL" local-service="true" remote-service="false">
23        <column name="AuditIdentity" type="long" primary="true"></column>
24        <column name="Field" type="String" primary="true"></column>
25        <column name="Value" type="String"></column>
26    </entity>
27</service-builder>


pom.xml
  1<?xml version="1.0" encoding="UTF-8"?>
  2
  3<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  4    <modelVersion>4.0.0</modelVersion>
  5    <groupId>urn.inps.hcgw</groupId>
  6    <artifactId>hcgw-portlets</artifactId>
  7    <packaging>war</packaging>
  8    <name>Healthcare Gateway Portlets</name>
  9    <version>1.0</version>
 10   
 11    <build>
 12        <plugins>
 13            <plugin>
 14                <groupId>com.liferay.maven.plugins</groupId>
 15                <artifactId>liferay-maven-plugin</artifactId>
 16                <version>${liferay.version}</version>
 17                <configuration>
 18                    <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
 19                    <pluginType>portlet</pluginType>
 20                </configuration>
 21            </plugin>
 22            <plugin>
 23                <artifactId>maven-compiler-plugin</artifactId>
 24                <version>2.0.2</version>
 25                <configuration>
 26                    <encoding>UTF-8</encoding>
 27                    <source>1.5</source>
 28                    <target>1.5</target>
 29                </configuration>
 30            </plugin>
 31            <plugin>
 32                <groupId>org.apache.maven.plugins</groupId>
 33                <artifactId>maven-resources-plugin</artifactId>
 34                <version>2.3</version>
 35            </plugin>
 36        </plugins>
 37
 38        <resources>
 39            <resource>
 40                <directory>src/main/java</directory>
 41                <includes>
 42                    <include>**/*.properties</include>
 43                </includes>
 44            </resource>
 45            <resource>
 46                <directory>src/main/resources</directory>
 47                <includes>
 48                    <include>**/*.*</include>
 49                </includes>
 50            </resource>
 51        </resources>
 52    </build>
 53    <dependencies>
 54        <dependency>
 55            <groupId>com.liferay.portal</groupId>
 56            <artifactId>portal-service</artifactId>
 57            <version>${liferay.version}</version>
 58            <scope>provided</scope>
 59        </dependency>
 60        <dependency>
 61            <groupId>com.liferay.portal</groupId>
 62            <artifactId>util-bridges</artifactId>
 63            <version>${liferay.version}</version>
 64            <scope>provided</scope>
 65        </dependency>
 66        <dependency>
 67            <groupId>com.liferay.portal</groupId>
 68            <artifactId>util-taglib</artifactId>
 69            <version>${liferay.version}</version>
 70            <scope>provided</scope>
 71        </dependency>
 72        <dependency>
 73            <groupId>com.liferay.portal</groupId>
 74            <artifactId>util-java</artifactId>
 75            <version>${liferay.version}</version>
 76            <scope>provided</scope>
 77        </dependency>
 78        <dependency>
 79            <groupId>javax.portlet</groupId>
 80            <artifactId>portlet-api</artifactId>
 81            <version>2.0</version>
 82            <scope>provided</scope>
 83        </dependency>
 84        <dependency>
 85            <groupId>javax.servlet</groupId>
 86            <artifactId>servlet-api</artifactId>
 87            <version>2.4</version>
 88            <scope>provided</scope>
 89        </dependency>
 90        <dependency>
 91            <groupId>javax.servlet.jsp</groupId>
 92            <artifactId>jsp-api</artifactId>
 93            <version>2.0</version>
 94            <scope>provided</scope>
 95        </dependency>
 96
 97        <dependency>
 98            <groupId>xerces</groupId>
 99            <artifactId>xercesImpl</artifactId>
100            <version>2.9.1</version>
101        </dependency>
102        <dependency>
103            <groupId>commons-codec</groupId>
104            <artifactId>commons-codec</artifactId>
105            <version>1.3</version>
106        </dependency>
107        <dependency>
108            <groupId>commons-fileupload</groupId>
109            <artifactId>commons-fileupload</artifactId>
110            <version>1.2.1</version>
111        </dependency>
112        <dependency>
113            <groupId>commons-io</groupId>
114            <artifactId>commons-io</artifactId>
115            <version>1.4</version>
116        </dependency>
117        <dependency>
118            <groupId>org.apache.ws.security</groupId>
119            <artifactId>wss4j</artifactId>
120            <version>1.5.8</version>
121        </dependency>
122        <dependency>
123            <groupId>xalan</groupId>
124            <artifactId>xalan</artifactId>
125            <version>2.7.1</version>
126        </dependency>
127        <dependency>
128            <groupId>xalan</groupId>
129            <artifactId>serializer</artifactId>
130            <version>2.7.1</version>
131        </dependency>
132
133        <dependency>
134            <groupId>urn.messagebus.vos</groupId>
135            <artifactId>VOS-MessageLibrary-Core</artifactId>
136            <version>1.0-SNAPSHOT</version>
137        </dependency>
138        <dependency>
139            <groupId>urn.messagebus.vos</groupId>
140            <artifactId>HCGW-MessageLibrary</artifactId>
141            <version>1.0-SNAPSHOT</version>
142        </dependency>
143        <dependency>
144            <groupId>urn.messagebus.vos</groupId>
145            <artifactId>VOS-Transport-SOAP</artifactId>
146            <version>1.0-SNAPSHOT</version>
147        </dependency>
148    </dependencies>
149    <properties>
150        <liferay.auto.deploy.dir>X:/liferay-portal-6.1.0-hcgw/deploy</liferay.auto.deploy.dir>
151        <liferay.version>6.1.0</liferay.version>
152    </properties>
153</project>


Thanks in advance,
Ian Harrigan
Mika Koivisto
RE: Liferay 6.1 & maven service builder
1 de Março de 2012 11:23
Resposta

Mika Koivisto

LIFERAY STAFF

Ranking: Liferay Legend

Mensagens: 1505

Data de entrada: 7 de Agosto de 2006

Mensagens recentes

Just an FYI 6.1.0 ServiceBuilderMojo does not work because of wrong dependency versions. There's clashing slf4j versions so it should actually error out but weirdly enough it doesn't seem to do that according to Ian's log snippet.
Jonas Fonseca
RE: Liferay 6.1 & maven service builder
3 de Março de 2012 12:44
Resposta

Jonas Fonseca

Ranking: New Member

Mensagens: 12

Data de entrada: 20 de Outubro de 2010

Mensagens recentes

I was able to get liferay:build-service working by adding the following dependency exclusion in my own pom.xml, based on Mika Koivisto's patch:
https://github.com/mikakoivisto/liferay-maven-support/commit/26130e6ef360bd3314555928185c1e749a42f930

With this fix there's no need to modify files in .m2 or use the maven ant plugin.

 1
 2--- a/.../service-hook/pom.xml
 3+++ b/.../service-hook/pom.xml
 4@@ -19,6 +19,19 @@
 5                 <groupId>com.liferay.maven.plugins</groupId>
 6                 <artifactId>liferay-maven-plugin</artifactId>
 7                 <version>${liferay.version}</version>
 8+                <dependencies>
 9+                    <dependency>
10+                        <groupId>org.apache.jackrabbit</groupId>
11+                        <artifactId>jackrabbit-core</artifactId>
12+                        <version>2.1.2</version>
13+                        <exclusions>
14+                            <exclusion>
15+                                <groupId>org.slf4j</groupId>
16+                                <artifactId>jcl-over-slf4j</artifactId>
17+                            </exclusion>
18+                        </exclusions>
19+                    </dependency>
20+                </dependencies>
21                 <configuration>
22                     <apiDir>${basedir}/../services-service/src/main/java</apiDir>
23                     <pluginType>portlet</pluginType>
Jan Bub
RE: Liferay 6.1 & maven service builder
4 de Março de 2012 07:32
Resposta

Jan Bub

Ranking: Junior Member

Mensagens: 78

Data de entrada: 2 de Março de 2011

Mensagens recentes

Thank you for sharing Jonas. I was not able to make servicebuilder work by change my local repository. But your solution works for me, too. Very nice.