Fórumok

How to create LPKG or WAR File

Toshiro Mifune, módosítva 9 év-val korábban

How to create LPKG or WAR File

Regular Member Bejegyzések: 238 Csatlakozás dátuma: 2014.12.11. Legújabb bejegyzések
Hi all,

I have created a theme and some portlets. Now I want to upload it on my server and as I realised, I need to create lpkg or war file ... but I dont know how. Can you help me? Thanks.
thumbnail
Meera Prince, módosítva 9 év-val korábban

RE: How to create LPKG or WAR File

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
Hi
In your plugins SDK you can find directory called "dist" you can go there find all your plugins war files then you can directly deploy these into other portal servers.
generally in the development when we and deploy target then it will create war file and then it will be placed in deploy directory of portal.
http://www.liferaysavvy.com/2014/11/liferay-plugin-applications-deployment.html

http://www.liferaysavvy.com/2014/06/install-portlet-applications-in-liferay.html

Regards,
Meera Prince
Toshiro Mifune, módosítva 9 év-val korábban

RE: How to create LPKG or WAR File

Regular Member Bejegyzések: 238 Csatlakozás dátuma: 2014.12.11. Legújabb bejegyzések
First .. in folder
liferay-plugins-sdk-6.2

was not all my portlets ... so I try click with right mouse button to my portlet in eclipse then I went to export/web/war file s... so in this way I can export theme and portlets as war file and then install them on server

It works for some portlets. But I try to instal my theme I have created on my localhost and then I run my page with it ... but it show me that my page is not available

And I also created portlet with service builder and I put some data in the dataqbase ... then I exported it as war file, installed on server, run but same "...
Library is temporarily unavailable.
(Library is my portlet)

you know what to do?
thumbnail
Olaf Kock, módosítva 9 év-val korábban

RE: How to create LPKG or WAR File

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
Are you working with Liferay's plugins-sdk (e.g. Ant) or Maven? If you're Ant-based, just use ant dist. On Liferay IDE this will happen automatically, but the dist directory that Meera mentioned will be on the Filesystem, not in Liferay IDE's workspace. Search for the plugins-sdk that comes with Liferay-IDE.
Nikos Samaras, módosítva 8 év-val korábban

RE: How to create LPKG or WAR File

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2016.01.14. Legújabb bejegyzések
Hello,

I would like to create a .lpkg with maven and during the building I would like to copy the wars from different targets in that myPackage.lpkg.

I use that lines in the parent pom.xml the myPackage.lpkg is created but the wars are not in myPackage.lpkg

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy file="XXXXXX/myProject.war"
tofile="XXXXX/myPackage.lpkg" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

Can you help me?

Than you in advance
Nikos
thumbnail
David H Nebinger, módosítva 8 év-val korábban

RE: How to create LPKG or WAR File

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Hmm, we usually don't build lpkg files for deployment. The liferay marketplace builds them, but outside of that we don't necessarily worry about it.

Your copy task is not going to work, btw. An lpkg file is a zip file, but it contains war files, it's not that it is a war file.
Nikos Samaras, módosítva 7 év-val korábban

RE: How to create LPKG or WAR File

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2016.01.14. Legújabb bejegyzések
Hello,

Finally I found how to create an .lpkg file with maven and store in it war files.

In my case the main goal was to deploy the portlet-wars on weblogic server.

These wars should be created during the build process and store them in the .lpkg file.

My projects was like that: I have a parent pom and children poms that point on the parent pom.

In parent pom should have the following lines in orer to create the .lpkg in target path and read the assembly.xml in order to includes that children wars and excludes the parent pom dependencies.

<!-- Creating lpkg package and put all the .war files in it -->
			 <plugin>
		        <artifactid>maven-assembly-plugin</artifactid>
		        <executions>
		          <execution>
		            <id>make-bundles</id>
		            <phase>package</phase>
		            <goals>
		              <goal>single</goal>
		            </goals>
		            <configuration>
		              <descriptors>
		                <descriptor>assembly/assembly.xml</descriptor>
		              </descriptors>
		            </configuration>
		          </execution>
		        </executions>
		    </plugin>
			
		 	<plugin>
				<groupid>org.apache.maven.plugins</groupid>
				<artifactid>maven-antrun-plugin</artifactid>
				<version>1.8</version>
				<executions>
					<execution>
						<phase>package</phase>
						<configuration>
							 <target>
								<copy file="${project.build.directory}/${project.artifactId}-${project.version}-bin.zip" tofile="${project.build.directory}/${project.artifactId}-${project.version}.lpkg" />
							</target> 
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>  


As you have seen from the parent pom above the assembly.xml file is in the path assembly/assembly.xml (myParentPath/assembly/assembly.xml).

That file has the following lines in order to copy the wars from specific children paths to .lpkg and exclude the dependency jars that are in the parent pom.

In my case I didn't want jars in .lpkg that is the reason that I exclude them.

<assembly>
  
  <id>bin</id>
  
  <formats>
    <format>zip</format>	
  </formats>

  <includebasedirectory>false</includebasedirectory>
  
  <dependencysets>
  
      <dependencyset>
          	
			<useprojectartifact>false</useprojectartifact>	 
			
			<unpack>false</unpack>
			
			<excludes>
				<exclude>javax.servlet:servlet-api</exclude>
				<exclude>javax.servlet:jstl</exclude>
				<exclude>com.google.guava:guava</exclude>
				<exclude>org.mockito:mockito-all</exclude>
				<exclude>joda-time:joda-time</exclude>
				<exclude>javax.portlet:portlet-api</exclude>
				<exclude>com.liferay.portal:portal-service</exclude>
				<exclude>com.liferay.portal:portal-impl</exclude>
				<exclude>com.liferay.portal:util-java</exclude>
				<exclude>com.liferay.portal:util-bridges</exclude>
				<exclude>com.liferay.portal:util-taglib</exclude>
				<exclude>org.springframework:spring-context</exclude>
				<exclude>org.springframework:spring-web</exclude>
				<exclude>org.springframework:spring-core</exclude>
				<exclude>org.springframework:spring-webmvc</exclude>
				<exclude>org.springframework:spring-webmvc-portlet</exclude>
				<exclude>org.springframework:spring-tx</exclude>
				<exclude>org.springframework:spring-jdbc</exclude>
				<exclude>org.springframework:spring-aop</exclude>
				<exclude>org.springframework:spring-aspects</exclude>
				<exclude>javax.transaction:javax.transaction-api</exclude>	
				<exclude>org.springframework:spring-beans</exclude>	
				<exclude>org.springframework:spring-expression</exclude>
				<exclude>log4j:log4j</exclude>				
				<exclude>aopalliance:aopalliance</exclude>
				<exclude>org.aspectj:aspectjweaver</exclude>
				<exclude>commons-io:commons-io</exclude>
				<exclude>commons-logging:commons-logging</exclude>				
				<exclude>org.slf4j:slf4j-simple</exclude>
				<exclude>org.slf4j:slf4j-log4j12</exclude>				
				<exclude>slf4j-api:slf4j-api</exclude>				
				<exclude>commons-fileupload:commons-fileupload</exclude>
				<exclude>org.apache.directory.studio:org.apache.commons.lang</exclude>
				<exclude>org.javassist:javassist</exclude>
				<exclude>javax.validation:validation-api</exclude>
				<exclude>javax.servlet:servlet-api</exclude>
				<exclude>javax.servlet.jsp:jsp-api</exclude>
				<exclude>javax.servlet.jsp:jstl</exclude>
				<exclude>com.google.guava:guava</exclude>
				<exclude>joda-time:joda-time</exclude>
				<exclude>org.springframework:spring-test</exclude>
				<exclude>junit:junit</exclude>
				<exclude>org.powermock:powermock-module-junit4</exclude>
				<exclude>org.powermock:powermock-api-easymock</exclude>
				<exclude>org.mockito:mockito-all</exclude>				
			</excludes>
			
      </dependencyset>
	  
  </dependencysets>
  
  <filesets>	
	
	<fileset>
	  	<directory>${project.basedir}/target/classes</directory>
	  	<outputdirectory>/</outputdirectory>
	  	<includes>
        	<include>liferay-marketplace.properties</include>
        </includes>
	  </fileset>
	
	<fileset>
      <directory>${project.basedir}/firstChild-portlet/target/</directory>
      <outputdirectory>/</outputdirectory>
      <includes>
        <include>*.war</include>
      </includes>	   
    </fileset>
   
   <fileset>
      <directory>${project.basedir}/secondChild-portlet/target/</directory>
      <outputdirectory>/</outputdirectory>
      <includes>
        <include>*.war</include>
      </includes>	  
    </fileset>
	
	<fileset>
      <directory>${project.basedir}/thirdChild-portlet/target/</directory>
      <outputdirectory>/</outputdirectory>
      <includes>
        <include>*.war</include>
      </includes>	   
    </fileset>
	
	<fileset>
      <directory>${project.basedir}/fourthChild-portlet/target/</directory>
      <outputdirectory>/</outputdirectory>
      <includes>
        <include>*.war</include>
      </includes>	  
    </fileset>
	
<fileset>
      <directory>${project.basedir}/fifthChild-portlet/target/</directory>
      <outputdirectory>/</outputdirectory>
      <includes>
        <include>*.war</include>
      </includes>	   
    </fileset>
      
  </filesets>
  
</assembly>


Thank you
Nikos
thumbnail
Rajan Bhatt, módosítva 6 év-val korábban

RE: How to create LPKG or WAR File

New Member Bejegyzések: 7 Csatlakozás dátuma: 2017.05.23. Legújabb bejegyzések
How to create LPKG file in Liferay DXP?
thumbnail
David H Nebinger, módosítva 6 év-val korábban

RE: How to create LPKG or WAR File

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Nikos Samaras:
Finally I found how to create an .lpkg file with maven and store in it war files.


Actually this is not recommended. The lpkg format is an internal one used by Liferay that could change at any time. And by any time, I don't mean just version bumps like 7.0 to 7.1. They could change it on every GA release, every fix pack, ...

Besides, you're on the wrong path anyway. To bundle for deployment to weblogic, you should be using the deployment helper. The Liferay deployment helper allows you to bundle all of your artifacts into a war file, this war file can be deployed via the admin console (read: one push to populate all of your nodes), and it will take care of putting the contained artifacts into the node's Liferay deploy folder where Liferay will pick up and process as normal.

https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/deployment-helper-gradle-plugin
thumbnail
Matthias Heinrich, módosítva 6 év-val korábban

RE: How to create LPKG or WAR File

New Member Bejegyzések: 3 Csatlakozás dátuma: 2012.12.21. Legújabb bejegyzések
Thanks for your information.

But I think the goal was to create some kind of package to install a bunch of portlet, modules etc. like an app. So it will list on the "AppManager --> Apps" menu.
But without tu publish it on the app-store.

For this reason the deployment-helper won't work.

Is there any build-plugin to gain this goal?

Thanks a lot.