Reputation: 33
So, my goal is to learn to create Liferay portlet using React in framework development. I have follewed instructions and used maven to build my project
mvn archetype:generate \
-DarchetypeGroupId=com.liferay \
-DarchetypeArtifactId=com.liferay.project.templates.npm.react.portlet \
-DgroupId=com.liferay \
-DartifactId=my-npm-react-portlet \
-Dpackage=com.liferay.npm.react \
-Dversion=1.0 \
-DclassName=MyNpmReactPortlet \
-DpackageJsonVersion=1.0.0
Proplem now occures when I am deploying my freshy made portlet. Server doesnt print anything else to console than processing my-npm-react-portlet-1.0.jar
I have checked my modules with Blade sh lb and blade sh diag and outcome is:
Unresolved requirement: Import-Package: com.liferay.frontend.js.loader.modules.extender.npm; version="[1.0.0,2.0.0)"
Project bnd.bnd
Bundle-Name: my-npm-react-portlet <br/>
Bundle-SymbolicName: com.liferay.npm.react <br/>
Bundle-Version: 1.0 <br>
Export-Package: com.liferay.npm.react.constants <br/>
Web-ContextPath: /my-npm-react-portlet <br/>
-jsp: *.jsp,*.jspf <br/>
-plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin <br/>
-plugin.npm: com.liferay.ant.bnd.npm.NpmAnalyzerPlugin <br/>
-plugin.resourcebundle: <br/>com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin <br/>
-plugin.sass: com.liferay.ant.bnd.sass.SassAnalyzerPlugin <br/>
-sass: *
Bundle-Name: my-npm-react-portlet
Bundle-SymbolicName: com.liferay.npm.react
Bundle-Version: 1.0
Export-Package: com.liferay.npm.react.constants
Web-ContextPath: /my-npm-react-portlet
-jsp: *.jsp,*.jspf
-plugin.jsp: com.liferay.ant.bnd.jsp.JspAnalyzerPlugin
-plugin.npm: com.liferay.ant.bnd.npm.NpmAnalyzerPlugin
-plugin.resourcebundle: com.liferay.ant.bnd.resource.bundle.ResourceBundleLoaderAnalyzerPlugin
-plugin.sass: com.liferay.ant.bnd.sass.SassAnalyzerPlugin
-sass: *
And last pom.xml (code block doesn't want to work with this one).
<?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/xsd/maven-4.0.0.xsd"
>
<modelVersion>4.0.0</modelVersion>
<groupId>com.liferay</groupId>
<artifactId>my-npm-react-portlet</artifactId>
<version>1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.liferay</groupId>
<artifactId>com.liferay.frontend.js.loader.modules.extender</artifactId>
<version>1.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.portal.kernel</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>com.liferay.util.taglib</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
<excludes>
<exclude>**/META-INF/resources/**/.sass-cache/</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<goals>
<goal>bnd-process</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>biz.aQute.bnd</groupId>
<artifactId>biz.aQute.bndlib</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.liferay</groupId>
<artifactId>com.liferay.ant.bnd</artifactId>
<version>2.0.41</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.liferay</groupId>
<artifactId>com.liferay.css.builder</artifactId>
<version>2.0.2</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<docrootDirName>src/main/resources</docrootDirName>
</configuration>
</plugin>
</plugins>
</build>
</project>
I will appreciate any help according this proplem!
Upvotes: 1
Views: 1180
Reputation: 1686
I recently worked on a Gradle, bnd Liferay module. I ran into similar unresolved requirement issues. I am not sure if this will help you or applies to your issue.
In my case, I found that the bnd.bnd file needs the import statements to be in the exact specific format. I am guessing it applies to the export statements as well. If not in this format, there is no error but there are deployment/run time issues like yours.
The following with commas, * and \ worked for me, rather than multiple import statements. I ran into this information buried on the Liferay forums. I don't remember the exact post that helped me.
Import-Package: \
com.xyz.core.api, \
com.xyz..core.api.model, \
com.liferay.portal.kernel.*, \
*
Here is the bnd documentation in case it helps: http://bnd.bndtools.org/chapters/390-wrapping.html Hope this helps.
Upvotes: 1