Deploying maven liferay project to remote Jboss based Liferay portal - jboss7.x

I'm new with Liferay portal.
here is my config
--Liferay 6.1 deployed on JBoss AS 7.1.1 Final
--Maven 3.1.1
I can easily deploy my portlet(maven project) in local Liferay instance
but i'm trying to deploy this portlet to a remote instance
here is a part of my pom.xml
<properties>
<liferay.version>6.1.2</liferay.version>
<liferay.parent.server>C:\DEV\Env\JBoss</liferay.parent.server>
<liferay.auto.deploy.dir>${liferay.parent.server}\deploy</liferay.auto.deploy.dir>
<liferay.app.server.deploy.dir>${liferay.parent.server}\jboss-as-7.1.1.Final\standalone\deployments</liferay.app.server.deploy.dir>
<liferay.app.server.lib.global.dir>${liferay.parent.server}\jboss-as-7.1.1.Final\modules\com\liferay\portal\main</liferay.app.server.lib.global.dir>
<liferay.app.server.portal.dir>${liferay.parent.server}\jboss-as-7.1.1.Final\standalone\deployments\ROOT.war</liferay.app.server.portal.dir>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.liferay.maven.plugins</groupId>
<artifactId>liferay-maven-plugin</artifactId>
<version>${liferay.version}</version>
<configuration>
<autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
<appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
<appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
<appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
<liferayVersion>${liferay.version}</liferayVersion>
<pluginType>portlet</pluginType>
</configuration>
</plugin>
...
</build>
I would " liferay.parent.server " to target the remote directory something like 192.168.1.2/Env/JBoss
I have been working on for a long time
i will really appreciate your helps
Thank you

You need to install the Remote IDE Connector plugin to the remote instance of Liferay portal.
There are both CE version and EE version
Now you can deploy it via your Eclipse: tutorial
Or you can use Jenkins plugin, but be aware this issue (you need to download the source, fix it, and build it)

I remember that Liferay not support remote connector for JBoss.You can see this documents regard enter link description here Maven plugin for JBoss.

Sure, you can do remote deploy by maven plugin. You can read this guide http://www.dontesta.it/blog/en/blog-2/cms/liferay/liferay-maven-come-fare-il-deploy-remoto-dei-plugin/
In this article we will see a possible solution for remotely deploying the artifact of a Liferay project based on the maven
The plugin maven wagon-maven-plugin (or wagon) is what will allow you copy the WAR of our portlet on the remote server and then the hot deployment of Liferay (of which I recommend reading the hot deployment versus auto deploy) will carry out the actual installation. Listing 1 shows the wagon plugin configuration included within the plugins section of our project pom.
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<fromDir>${project.build.directory}/</fromDir>
<includes>*.war</includes>
<url>scp://${jboss.deploy.username}:${jboss.deploy.password}#${jboss.deploy.hostname}/</url>
<toDir>${jboss.deploy.liferay.dir}</toDir>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

Related

How to add jar Non-osgi jar files as dependency to eclipse plugin?

I am developing an eclipse plugin using tycho build ,It needs some non-osgi jar files as dependency.when I add the dependency in my pom file ,It does not take the dependency during maven build.
So, I have tried to make a osgi bundle which contains all the required dependencies by using the following Plugin.
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.0</version>
<extensions>true</extensions>
<configuration>
<manifestLocation>META-INF</manifestLocation>
<instructions>
<Bundle-SymbolicName>Osgi-bundle</Bundle-SymbolicName>
<Bundle-Name>Osgi-dependency</Bundle-Name>
<Bundle-Version>1.0.0</Bundle-Version>
<Export-Package>*</Export-Package>
<Private-Package>com.foo.bundle</Private-Package>
<Bundle-Activator>com.foo.bundle.Activator</Bundle-Activator>
<Import-Package>*;resolution:=optional</Import-Package>
<Embed-Dependency>*;scope=compile|runtime;inline=true</Embed-Dependency>
<Embed-Directory>target/dependency</Embed-Directory>
<Embed-StripGroup>true</Embed-StripGroup>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
After that i have provided the dependency of this osgi bundle to the eclipse plugin .But still it does not take the dependency.
I have gone through lot of sites.But I am not able to get the solution for this maven build in continuous integration
But,When I tried creating new plugin project with existing jar and add the osgi bundle and export the plugin .Its work fine. But I am in need to maven continuous builds.
Please provide some solution to add the dependency to eclipse plugin project.
I have solved the problem by creating p2 repository and deployed it in the server.I have created a target definition file and linked it to my plugin project.
We can convert non osgi jars to p2 repository by using the following code.
<build>
<plugins>
<plugin>
<groupId>org.reficio</groupId>
<artifactId>p2-maven-plugin</artifactId>
<version>1.1.2-SNAPSHOT</version>
<executions>
<execution>
<id>default-cli</id>
<configuration>
<artifacts>
<!-- specify your depencies here -->
<!-- groupId:artifactId:version -->
<artifact>
<id>org.slf4j:slf4j-log4j12:1.7.10</id>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
'
For detailed information this site is very helpfull.
http://www.vogella.com/tutorials/EclipseTycho/article.html#convertjars
One possible option is to download jars into separate folder using maven-dependency-plugin, configure classpath in manifest for OSGi bundle and do not forget to include jars in build.

remote deployment to wildfly using cargo fails

I am trying to deploy an application to a remote wildfly 8.1.0.Final using the cargo maven plugin and it fails with error Operation failed: Could not connect to remote://10.0.0.165:9990 in 5000ms.
The application is the default application generated by the maven archetype cargo-archetype-remote-deployment. This application can be successfully deployed to jboss 7.1.1.Final without modification to the pom. I have added the following profile to the pom
<profile>
<id>wildfly8x</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>wildfly8x</containerId>
</container>
<properties>
<!--<cargo.jboss.management-native.port>9999</cargo.jboss.management-native.port>-->
<cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>
</properties>
</configuration>
<!--
The JBoss remote deployer requires some additional dependencies. Read more on:
http://cargo.codehaus.org/JBoss+Remote+Deployer
-->
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-controller-client</artifactId>
<version>7.0.2.Final</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
which is a copy of the jboss7x profile with the changes for wildfly.
The properties at the beginning have been changed to correct hostname and username and passwords. I can log into the 10.0.0.165:9990 using http and access the web interface I can also us the jboss-cli interface to login to 10.0.0.165:9990 and deploy the application to the server using the command line. I have also increased the time out as recommended but without success.
It would appear that the remote:// protocol is not available in wildfly or the name is incorrect and cargo is expecting to be able to connect using it.
I have had problems with wildfly and the changes made to interfaces in the past when I connected Netbeans 8 to it. I did eventually find the solution to that by adding back the native management interface which was removed in one of the beta versions.
Does anybody have any knowledge on how to get this working? A copy of a pom from a working example would be good. Before replying please make sure that your reply is relevant to the versions specified as jboss/redhat make changes between dot point releases with very little documentation.
Hy,
I just have the same issue, i gues you copy the example from:
http://cargo.codehaus.org/JBoss+Remote+Deployer
And I found that the example is for JBOSS 7...
For Wildfly this is what worked for me:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.12</version>
<configuration>
<container>
<containerId>wildfly8x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.username>consoleUser</cargo.remote.username>
<cargo.remote.password>consolePassword</cargo.remote.password>
<cargo.hostname>IP_ADDRESS</cargo.hostname>
<cargo.jboss.management-http.port>9990</cargo.jboss.management-http.port>
</properties>
</configuration>
</configuration>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-controller-client</artifactId>
<version>8.2.0.Final</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
The shame on this is the documentation and that no java people community have answer this post... have to be a .NET guy... what a shame....

Cloudbees Lift ClickStart pom.xml jetty dependency?

CloudBees Lift template pom.xml specifies Jetty as a dependency, even though Jetty is not available for Cloudbees yet. Is that just leftover from a boilerplate pom.xml, or is it required for something?
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.26</version>
</dependency>
...
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.22</version>
<configuration>
<contextPath>/</contextPath>
<scanIntervalSeconds>5</scanIntervalSeconds>
</configuration>
</plugin>
I suggest you fork https://github.com/CloudBees-community/lift_template, try the clickstart without this dependency, and create a pull-request if you successfully got it deployed without this dependency
I think that is a left over from lift - we can run jetty now via plain JVM apps, if that is what is preferred (however a new clickstart will be needed).
http://developer.cloudbees.com/bin/view/RUN/Java+Container
It's not necessary when running your application on CloudBees, but it would allow you to run it locally, should you want to.

Cobertura maven plugin when to download

Can anyone tell me to locate and download the cobertura maven plugin? I've looked on the web. On the Corbertura homepage there is a URL http://maven-plugins.sourceforge.net/repository/maven-plugins/ to the download, but that page is dead.
The Cobertura plugin for Maven can be downloaded from the Maven central repository, however you shouldn't need to download the plugin directly, it is sufficient to declare the plugin in your POM, Maven will download it automatically from the central repository (assuming you have an internet connection).
The configuration would be something like this:
<reporting>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>

maven javaee application client plugin

I am pretty new to maven.
Is there any plugin or packaging type suitable for building application client jar file ?
I want to add the application-client.xml file to the META-INF folder inside the jar.
The normal jar packaging doesn't include the file.
You should only need to define the project with jar packaging (and as it is the default you don't need to declare it).
If you define the application-client.xml in the src/main/resources/META-INF folder it will be included in the META-INF folder of the final jar.
To define additional information you need to configure the jar plugin as below.
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<configuration>
<archive>
<manifest>
<mainClass>com.mycompany.app.App</mainClass>
<addClasspath>true</addClasspath>
</manifest>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
Check out the guide to working with manifests for full details
I'm not very familiar with the JavaEE support in Maven, but it looks like the ejb plugin can generate a client jar as well if configured properly. Check this page out:
Maven EJB Plugin - Generating an EJB client