amusarra
2/6/2016 - 6:19 PM

Liferay Maven: Come fare il deploy remoto

Liferay Maven: Come fare il deploy remoto

mvn -B archetype:generate \
  -DarchetypeRepository=$HOME/.m2/repository \
  -DarchetypeArtifactId=liferay-portlet-archetype \
  -DarchetypeGroupId=com.liferay.maven.archetypes \
  -DarchetypeVersion=6.2.10.15 \
  -DartifactId=login-sample-portlet \
  -DgroupId=it.dontesta.labs.liferay.portlets \
  -Dversion=1.0.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[INFO] Archetype defined by properties
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/liferay/maven/archetypes/liferay-portlet-archetype/6.2.10.15/liferay-portlet-archetype-6.2.10.15.jar
[INFO] Downloaded: https://repo.maven.apache.org/maven2/com/liferay/maven/archetypes/liferay-portlet-archetype/6.2.10.15/liferay-portlet-archetype-6.2.10.15.jar (6 KB at 3.4 KB/sec)
[INFO] Downloading: https://repo.maven.apache.org/maven2/com/liferay/maven/archetypes/liferay-portlet-archetype/6.2.10.15/liferay-portlet-archetype-6.2.10.15.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/com/liferay/maven/archetypes/liferay-portlet-archetype/6.2.10.15/liferay-portlet-archetype-6.2.10.15.pom (2 KB at 4.1 KB/sec)
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: liferay-portlet-archetype:6.2.10.15
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: it.dontesta.labs.liferay.portlets
[INFO] Parameter: artifactId, Value: login-sample
[INFO] Parameter: version, Value: 1.0.0-SNAPSHOT
[INFO] Parameter: package, Value: it.dontesta.labs.liferay.portlets
[INFO] Parameter: packageInPathFormat, Value: it/dontesta/labs/liferay/portlets
[INFO] Parameter: package, Value: it.dontesta.labs.liferay.portlets
[INFO] Parameter: version, Value: 1.0.0-SNAPSHOT
[INFO] Parameter: groupId, Value: it.dontesta.labs.liferay.portlets
[INFO] Parameter: artifactId, Value: login-sample-portlet
[INFO] project created from Archetype in dir: /Users/amusarra/Documents/Articoli/MyBlog/Liferay/DeployRemoto/sources/login-sample-portlet
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.630 s
[INFO] Finished at: 2016-02-06T19:15:33+01:00
[INFO] Final Memory: 12M/156M
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-war-plugin:2.2:war (default-war) @ login-sample-portlet ---
[INFO] Packaging webapp
[INFO] Assembling webapp [login-sample-portlet] in [/Users/amusarra/Documents/Articoli/MyBlog/Liferay/DeployRemoto/sources/login-sample-portlet/target/login-sample-portlet-1.0.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/amusarra/Documents/Articoli/MyBlog/Liferay/DeployRemoto/sources/login-sample-portlet/src/main/webapp]
[INFO] Webapp assembled in [57 msecs]
[INFO] Building war: /Users/amusarra/Documents/Articoli/MyBlog/Liferay/DeployRemoto/sources/login-sample-portlet/target/login-sample-portlet-1.0.0-SNAPSHOT.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- wagon-maven-plugin:1.0:upload (default-cli) @ login-sample-portlet ---
[INFO] Uploading /Users/amusarra/Documents/Articoli/MyBlog/Liferay/DeployRemoto/sources/login-sample-portlet/target/login-sample-portlet-1.0.0-SNAPSHOT.war to scp://10.9.12.180///opt/liferay-portal-6.2-ee-sp14/deploy/login-sample-portlet-1.0.0-SNAPSHOT.war ...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.493 s
[INFO] Finished at: 2016-02-08T09:22:08+01:00
[INFO] Final Memory: 38M/409M
[INFO] ------------------------------------------------------------------------
19:11:07,665 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner) 19:11:07,664 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing login-sample-portlet-1.0.0-SNAPSHOT.war
19:11:07,697 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner) 19:11:07,697 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:79] Copying portlets for /opt/liferay-portal-6.2-ee-sp14/deploy/login-sample-portlet-1.0.0-SNAPSHOT.war
19:11:07,711 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner) 19:11:07,711 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:863] Deploying login-sample-portlet-1.0.0-SNAPSHOT.war
19:11:07,713 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Expanding: /opt/liferay-portal-6.2-ee-sp14/deploy/login-sample-portlet-1.0.0-SNAPSHOT.war into /var/folders/fh/kkrxx_9x38s3cfzvnhgf8xc80000gn/T/20160207191107713
19:11:07,735 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to /var/folders/fh/kkrxx_9x38s3cfzvnhgf8xc80000gn/T/20160207191107713/WEB-INF
19:11:07,742 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to /var/folders/fh/kkrxx_9x38s3cfzvnhgf8xc80000gn/T/20160207191107713/WEB-INF/classes
19:11:07,744 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to /var/folders/fh/kkrxx_9x38s3cfzvnhgf8xc80000gn/T/20160207191107713/WEB-INF/classes
19:11:07,751 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to /var/folders/fh/kkrxx_9x38s3cfzvnhgf8xc80000gn/T/20160207191107713/WEB-INF
19:11:07,754 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to /var/folders/fh/kkrxx_9x38s3cfzvnhgf8xc80000gn/T/20160207191107713/WEB-INF/jsp
19:11:07,837 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner) 19:11:07,837 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:2391] Modifying Servlet 2.4 /var/folders/fh/kkrxx_9x38s3cfzvnhgf8xc80000gn/T/20160207191107713/WEB-INF/web.xml
19:11:07,843 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Warning: META-INF/MANIFEST.MF modified in the future.
19:11:07,844 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Warning: META-INF/maven/it.dontesta.labs.liferay.portlets/login-sample-portlet/pom.properties modified in the future.
19:11:07,845 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Warning: META-INF/maven/it.dontesta.labs.liferay.portlets/login-sample-portlet/pom.xml modified in the future.
19:11:07,846 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Warning: view.jsp modified in the future.
19:11:07,851 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Warning: META-INF modified in the future.
19:11:07,852 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Warning: META-INF/maven modified in the future.
19:11:07,852 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Warning: META-INF/maven/it.dontesta.labs.liferay.portlets modified in the future.
19:11:07,853 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Warning: META-INF/maven/it.dontesta.labs.liferay.portlets/login-sample-portlet modified in the future.
19:11:07,856 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 31 files to /opt/liferay-portal-6.2-ee-sp14/jboss-7.1.1/standalone/deployments/login-sample-portlet.war
19:11:07,877 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Copying 1 file to /opt/liferay-portal-6.2-ee-sp14/jboss-7.1.1/standalone/deployments/login-sample-portlet.war
19:11:07,878 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner)   Deleting directory /var/folders/fh/kkrxx_9x38s3cfzvnhgf8xc80000gn/T/20160207191107713
19:11:07,886 INFO  [stdout] (com.liferay.portal.kernel.deploy.auto.AutoDeployScanner) 19:11:07,886 INFO  [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:91] Portlets for /opt/liferay-portal-6.2-ee-sp14/deploy/login-sample-portlet-1.0.0-SNAPSHOT.war copied successfully. Deployment will start in a few seconds.
19:11:10,258 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015003: Found login-sample-portlet.war in deployment directory. To trigger deployment create a file called login-sample-portlet.war.dodeploy
19:11:10,290 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "login-sample-portlet.war"
19:11:10,864 INFO  [stdout] (MSC service thread 1-5) 19:11:10,863 INFO  [MSC service thread 1-5][HotDeployEvent:145] Plugin login-sample-portlet requires marketplace-portlet
19:11:10,865 INFO  [stdout] (MSC service thread 1-5) 19:11:10,865 INFO  [MSC service thread 1-5][HotDeployImpl:217] Deploying login-sample-portlet from queue
19:11:10,866 INFO  [stdout] (MSC service thread 1-5) 19:11:10,865 INFO  [MSC service thread 1-5][PluginPackageUtil:1016] Reading plugin package for login-sample-portlet
19:11:10,942 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/login-sample-portlet]] (MSC service thread 1-5) Initializing Spring root WebApplicationContext
19:11:10,956 INFO  [stdout] (MSC service thread 1-5) 19:11:10,955 INFO  [MSC service thread 1-5][PortletHotDeployListener:344] Registering portlets for login-sample-portlet
19:11:11,144 INFO  [stdout] (MSC service thread 1-5) 19:11:11,144 INFO  [MSC service thread 1-5][PortletHotDeployListener:492] 1 portlet for login-sample-portlet is available for use
19:11:11,185 INFO  [org.jboss.web] (MSC service thread 1-5) JBAS018210: Registering web context: /login-sample-portlet
19:11:11,237 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "login-sample-portlet.war"
<?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>it.dontesta.labs.liferay.portlets</groupId>
  <artifactId>login-sample</artifactId>
  <packaging>war</packaging>
  <name>login-sample Portlet</name>
  <version>1.0.0-SNAPSHOT</version>
  <properties>
    <!-- Remote JBoss Liferay Bundle -->
    <jboss.deploy.hostname>192.168.43.226</jboss.deploy.hostname>
    <jboss.deploy.username>liferaydev</jboss.deploy.username>
    <jboss.deploy.password>liferaydev</jboss.deploy.password>
    <jboss.deploy.liferay.dir>/home/liferaydev/liferay-portal-6.2-ee-sp14/deploy</jboss.deploy.liferay.dir>
    <!-- End Remote JBoss Liferay Bundle -->
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>com.liferay.maven.plugins</groupId>
        <artifactId>liferay-maven-plugin</artifactId>
        <version>${liferay.maven.plugin.version}</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>build-css</goal>
            </goals>
          </execution>
        </executions>
        <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>
      <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>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <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>
  <dependencies>
    <dependency>
      <groupId>com.liferay.portal</groupId>
      <artifactId>portal-service</artifactId>
      <version>${liferay.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.liferay.portal</groupId>
      <artifactId>util-bridges</artifactId>
      <version>${liferay.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.liferay.portal</groupId>
      <artifactId>util-taglib</artifactId>
      <version>${liferay.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.liferay.portal</groupId>
      <artifactId>util-java</artifactId>
      <version>${liferay.version}</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>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>