Liferay Service Builder - liferay

First i had download Liferay with Eclipse. I had create a Liferay project and i add a service.xml in my portlet (in my project Liferay) to use Service Builder.
When i click on Build Service button (look image) Button Build Service
I have that error :
`
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Net'COFILMO - Pom parent
[INFO] Net'AVEO - Portlets - Pom parent
[INFO] app_chequier
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Net'COFILMO - Pom parent 1.0.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Net'COFILMO - Pom parent ........................... FAILURE [ 0.002 s]
[INFO] Net'AVEO - Portlets - Pom parent ................... SKIPPED
[INFO] app_chequier ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.206 s
[INFO] Finished at: 2017-11-16T14:13:33+01:00
[INFO] Final Memory: 6M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "build-service". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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 articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException
`
I don't know how i can resolve the problem.
Thanks in advance.

I use the Liferay version 7 and that it's my POM.xml
`<?xml version="1.0"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.utlimate</groupId>
<artifactId>UltimateTesting</artifactId>
<packaging>pom</packaging>
<name>UltimateTesting</name>
<version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>com.liferay</groupId>
<artifactId>com.liferay.portal.tools.service.builder</artifactId>
<version>1.0.175</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
<modules>
<module>UltimateTesting-portlet</module>
<module>UltimateTesting-portlet-service</module>
</modules>
</project>`

Related

Bytecompilation is done with /usr/bin/python and not /usr/bin/python3

I have a python project and I use maven to create an rpm file, using rpm-maven-plugin v2.1.3.
My project is written using python3.
When I create the rpm file, as part of a larger process of ms creation (with mvn install) I get syntax error on specific python3 syntax.
I can see that bytecompilation is done during the process, using /usr/bin/python which points to python2.7.
How can I force the bytecompile to use /usr/bin/python3?
I cannot change the global env variable since other ms are using python2.7
Also I cannot change the way mvn install is revoked since it's also used for all ms together.
I'm looking for somathing in the project itself I can define or change to force it to use python3.
I don't use a cmake file and I don't write my spec file (it is created as part of the rpm build)
Thank you!
spec file creation:
[2023-01-03T16:22:00.431Z] [INFO] Creating directory /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael
[2023-01-03T16:22:00.431Z] [INFO] Creating directory /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/BUILD
[2023-01-03T16:22:00.431Z] [INFO] Creating directory /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/RPMS
[2023-01-03T16:22:00.431Z] [INFO] Creating directory /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/SOURCES
[2023-01-03T16:22:00.431Z] [INFO] Creating directory /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/SPECS
[2023-01-03T16:22:00.431Z] [INFO] Creating directory /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/SRPMS
[2023-01-03T16:22:00.431Z] [INFO] Creating directory /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot
[2023-01-03T16:22:00.431Z] [INFO] Creating directory /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/buildroot
[2023-01-03T16:22:00.431Z] [INFO] Copying files to /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot/usr/share/yael
[2023-01-03T16:22:00.431Z] [INFO] Copying files to /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot/usr/share/yael
[2023-01-03T16:22:00.431Z] [INFO] Copying files to /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot/usr/share/yael
[2023-01-03T16:22:00.431Z] [INFO] Copying files to /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot/usr/share/yael
[2023-01-03T16:22:00.431Z] [INFO] Copying files to /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot/usr/share/yael
[2023-01-03T16:22:00.431Z] [INFO] Copying files to /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot/usr/share/yael
[2023-01-03T16:22:00.431Z] [INFO] Copying files to /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot/usr/share/yael
[2023-01-03T16:22:00.431Z] [INFO] Copying files to /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/tmp-buildroot/usr/share/yael
[2023-01-03T16:22:00.431Z] [INFO] Creating spec file /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/SPECS/ms-yael.spec
Exception Trace:
[2023-01-03T16:22:00.773Z] [INFO] + /usr/lib/rpm/check-buildroot
[2023-01-03T16:22:00.773Z] [INFO] + /usr/lib/rpm/redhat/brp-compress
[2023-01-03T16:22:00.773Z] [INFO] + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
[2023-01-03T16:22:00.773Z] [INFO] + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
[2023-01-03T16:22:00.773Z] [INFO] + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
[2023-01-03T16:22:00.773Z] [INFO] + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
[2023-01-03T16:22:00.773Z] [INFO] Compiling /home/jenkins/workspace/ms_side-pipeline/yael-packer/target/rpm/ms-yael/buildroot/usr/share/yael/yael/yaelFramework/yael1.py ...
[2023-01-03T16:22:00.773Z] [INFO] File "/usr/share/yael/yael/yaelFramework/yael1.py", line 33
[2023-01-03T16:22:00.773Z] [INFO] def send_response(self, response: Response, metadata: ResponseMetadata) -> None:
[2023-01-03T16:22:00.773Z] [INFO] ^
[2023-01-03T16:22:00.773Z] [INFO] SyntaxError: invalid syntax
POM plugins:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1.3</version>
<inherited>false</inherited>
<executions>
<execution>
<inherited>false</inherited>
<phase>install</phase>
<goals>
<goal>rpm</goal>
</goals>
</execution>
</executions>
<configuration>
<group>Networking/Admin</group>
<name>myProject</name>
<packager>Yael</packager>
<prefix>/usr/share</prefix>
<version>0</version>
<release>0</release>
<needarch>x86_64</needarch>
<mappings>
<mapping>
<directory>myProjectDir/</directory>
<filemode>777</filemode>
<sources>
<source>
<location>../yaelDir/</location>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>install</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/rpm/ms-yael/RPMS/x86_64/yaelRPM-0-0.x86_64.rpm</file>
<type>rpm</type>
</artifact>
<artifact>
<file>../git-commit.txt</file>
<classifier>git-commit</classifier>
<type>txt</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
I am trying to build my project using mvn install.

Failed to execute goal. Could not download npm. Got error code 404 from server

I'm trying to execute the following in my local AEM 6.5.12 instance...
mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=35 -D appTitle="WKND Sites Project" -D appId="wknd" -D groupId="com.adobe.aem.guides" -D artifactId="aem-guides-wknd" -D package="com.adobe.aem.guides.wknd" -D version="0.0.1-SNAPSHOT" -D aemVersion="6.5.12"
...but I keep getting errors, such as the following:
[INFO] Reactor Summary for WKND Sites Project 0.0.1-SNAPSHOT:
[INFO]
[INFO] WKND Sites Project ................................. SUCCESS [ 0.457 s]
[INFO] WKND Sites Project - Core .......................... SUCCESS [ 18.337 s]
[INFO] WKND Sites Project - UI Frontend ................... FAILURE [ 1.389 s]
[INFO] WKND Sites Project - Repository Structure Package .. SKIPPED
[INFO] WKND Sites Project - UI apps ....................... SKIPPED
[INFO] WKND Sites Project - UI content .................... SKIPPED
[INFO] WKND Sites Project - UI config ..................... SKIPPED
[INFO] WKND Sites Project - All ........................... SKIPPED
[INFO] WKND Sites Project - Integration Tests ............. SKIPPED
[INFO] WKND Sites Project - Dispatcher .................... SKIPPED
[INFO] WKND Sites Project - UI Tests ...................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.499 s
[INFO] Finished at: 2022-09-22T11:20:18-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.0:install-node-and-npm (install node and npm) on project aem-guides-wknd.ui.frontend: Could not download npm: Could not download https://registry.npmjs.org/npm/-/npm-6.17.14.tgz: Unknown host No such host is known (registry.npmjs.org) -> [Help 1]
Here's my root pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
<configuration>
<nodeVersion>v12.22.7</nodeVersion>
<npmVersion>6.17.14</npmVersion>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Maven Jar Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<!-- Maven Clean Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<!-- BND Maven Plugin -->
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>${bnd.version}</version>
<executions>
<execution>
<id>bnd-process</id>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<bnd>
Initially, JAVA HOME was pointing to a JRE folder, but I've since changed it to point to a JDK. Also, there's another discussion where it was suggested to do the following, which worked for several people, but did not work for me:
Change the npm verson of pom.xml in ui folder from 6.4.1 to 3.10.8.
UPDATE: After updating the pom.xml file's npmVersion, I ran Maven again and now get this error:
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.0:npm (npm run prod) on project aem-guides-wknd.ui.frontend: Failed to run task: 'npm run prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)

maven jaxb2 plugin is generating nothing

It's not clear to me if I'm able to use maven-jaxb2-plugin on a jdk11 maven project.
My pom.xml and mvn are using jdk11.
I know jaxb is not distributed with jdk 11.
I'm trying to generate code from wsdl:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.14.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
<generateDirectory>${project.basedir}/src/main/java/generated-sources/kenexa</generateDirectory>
<generatePackage>com.baeldung.springsoap.client.gen</generatePackage>
<schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
<noFileHeader>true</noFileHeader>
<schemaIncludes>
<include>*.wsdl</include>
</schemaIncludes>
</configuration>
</plugin>
I'm getting:
$ mvn generate-sources
[INFO] Scanning for projects...
[INFO]
[INFO] ------------< cat.catsalut.hes.visor:hes-visor-api-service >------------
[INFO] Building Visor HES 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-jaxb2-plugin:0.14.0:generate (default) # hes-visor-api-service ---
[INFO] Latest timestamp of the source resources is [2021-01-13 16:40:21.396], earliest timestamp of the target resources is [2021-01-13 16:40:28.828].
[INFO] Sources are up-to-date, XJC will be skipped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.616 s
[INFO] Finished at: 2021-01-13T16:40:40+01:00
[INFO] ------------------------------------------------------------------------
```
Any ideas?

Karate Api Testing with Maven and Jenkinsfile [duplicate]

I m new to Karate API automation tool and just try to set up the tool.I'm getting Compilation errors when I try to compile (Clean install ) my maven project.
Appreciate if anyone can help me on this. This is compiled and worked fine with 0.6.0 and I change it to the latest version. but now it's not working even for the previous one.
Find the bellow PoM file I m using :
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.test.karate</groupId>
<artifactId>Examples</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>0.8.0.RC3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit4</artifactId>
<version>0.8.0.RC3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-Werror</compilerArgument>
</configuration>
**Console log :**
Building Examples 0.0.1-SNAPSHOT
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/Ru`enter code here`nnerKarate.java:[3,24] package org.junit.runner does not exist
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[5,1] package com.intuit.karate.junit4 does not exist
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[7,20] package cucumber.api does not exist
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[8,26] package cucumber.api.junit does not exist
[ERROR] /Users/uwickdi/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[10,2] cannot find symbol
symbol: class RunWith
[ERROR] /Users/XXX/eclipse-workspace/Examples/src/main/java/RunnerKarate.java:[11,2] cannot find symbol
symbol: class CucumberOptions
[INFO] 6 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ----------------------------------------------------------------
Sounds like your local maven repository is corrupted so try to clean and re-download the JAR-s. You can use this command dependency:purge-local-repository

Drools decision tables precompilation using Maven

According to the drools 6.3 documentation, section 4.2.2.3 :
The KIE plugin for Maven ensures that artifact resources are validated and pre-compiled, it is recommended that this is used at all times. To use the plugin simply add it to the build section of the Maven pom.xml
Consequently, my pom.xml is :
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>6.3.0.Final-redhat-9</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-decisiontables</artifactId>
<version>6.3.0.Final-redhat-9</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>6.3.0.Final-redhat-9</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
I placed my decision table file, let's call it rules.xls, in the src/main/resources/my/company/package/. The one and only other file in my Maven project is the kmodule.xml file, which is in src/main/resources/META-INF/ and contains the minimal code :
<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"/>
Because I removed all the other dependencies (including the one that contains the Java objects used in the decision table), I was expecting drools to launch an error message of type cannot find symbol.
But when I try to clean install the project using Maven, the compilation succeed, a JAR file is created and it does contain the kmodule.xml and rules.xls files at the exact location where I placed them. No additional file generated during compilation, no error, no warning, nothing. Just a plain JAR with my files, a MANIFEST.MF file and a maven directory under META-INF.
In the maven trace, here are the plugins activated (in that order) :
[INFO] --- maven-clean-plugin:2.4.1:clean
[INFO] --- maven-resources-plugin:2.5:resources
[INFO] --- maven-compiler-plugin:2.3.2:compile
[INFO] --- maven-resources-plugin:2.5:testResources
[INFO] --- maven-compiler-plugin:2.3.2:testCompile
[INFO] --- maven-surefire-plugin:2.10:test
[INFO] --- maven-jar-plugin:2.3.2:jar
[INFO] --- maven-install-plugin:2.3.1:install
Nothing about the kie plugin. Any hint to activate the rules compilation at build time ?
In order to activate kie-maven-plugin it is also necessary to specify the correct packaging type in your pom.xml
<packaging>kjar</packaging>
I finally did find a way to activate the plugin. I added this to my pom.xml :
<pluginManagement>
<plugins>
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<version>6.3.0.Final-redhat-9</version>
<extensions>true</extensions>
<executions>
<execution>
<id>brms-rules-compilation</id>
<phase>generate-resources</phase>
<goals>
<goal>build</goal>
</goals>
<inherited>false</inherited>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
And now get a Drools compilation trace including :
[INFO] --- kie-maven-plugin:6.3.0.Final-redhat-9:build
[main] INFO org.drools.compiler.kie.builder.impl.KieRepositoryImpl - Adding KieModule from resource: FileResource[...]
I'm no Maven guru, this solution may not be the best (I even do not entirely understand what I wrote as a Maven perspective), so I would be glad to get an easier one.

Resources