Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution for MAVEN-14 for review and merge #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
.project
.settings
target
*.*~

*/**/.classpath
*/**/.project
*/**/.settings
*/**/target
*/**/target
241 changes: 241 additions & 0 deletions plugins/liferay-maven-plugin-components/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
<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>
<parent>
<artifactId>plugins</artifactId>
<groupId>com.liferay.maven</groupId>
<version>6.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>com.liferay.maven.plugins</groupId>
<artifactId>liferay-maven-plugin-components</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Liferay Maven Plugin Components</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>


<!-- Liferay -->

<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-impl</artifactId>
<version>${liferay.version}</version>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>${liferay.version}</version>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-bridges</artifactId>
<version>${liferay.version}</version>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-java</artifactId>
<version>${liferay.version}</version>
</dependency>

<!-- Maven -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${maven.version}</version>
</dependency>
<!-- Plexus -->

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
<version>1.0-alpha-33</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<version>1.5.5</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>1.5.5</version>
<scope>provided</scope>
</dependency>

<!-- External -->

<dependency>
<groupId>com.sun.media</groupId>
<artifactId>jai-codec</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.qdox</groupId>
<artifactId>qdox</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.4</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>easyconf</groupId>
<artifactId>easyconf</artifactId>
<version>0.9.5</version>
<exclusions>
<exclusion>
<groupId>javax.sql</groupId>
<artifactId>jdbc-stdext</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
<exclusion>
<groupId>xdoclet</groupId>
<artifactId>xdoclet</artifactId>
</exclusion>
<exclusion>
<groupId>xdoclet</groupId>
<artifactId>xdoclet-web-module</artifactId>
</exclusion>
<exclusion>
<groupId>xpp3</groupId>
<artifactId>xpp3_min</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jalopy</groupId>
<artifactId>jalopy</artifactId>
<version>1.5rc3</version>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<exclusions>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.java.dev.rome</groupId>
<artifactId>rome</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis-ant</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-core</artifactId>
<version>2.1.2</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>0.9</version>
</dependency>

<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.16</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/

package com.liferay.maven.plugins.components;

import java.io.File;
import java.util.Map;

import org.apache.maven.project.MavenProject;

/**
* The interface that will needs to be implemented by the various Code Builders which wil be used by the mojos to generate Liferay
* Portal specific code
*
* @author kamesh.sampath
*/
public interface LiferayPortalCodeBuilder
{

String ROLE = LiferayPortalCodeBuilder.class.getName();

/**
* This method is used to generate Java files based on Templates
*
* @param project
* - the maven project reference
* @param genSrcDir
* - the java source directory where the files will be generated
* @param variableMap
* - the model data to templates
* @throws Exception
* - an exception that might occur during template to code generation
*/
public void generateJavaFiles( MavenProject project, File genSrcDir, Map<String, Object> variableMap )
throws Exception;

/**
* This method is used to generate JSP files based on Templates
*
* @param project
* - the maven project reference
* @param jspSoureDirectory
* the web application directory where the jsp files be generated
* @param variableMap
* - the model data to templates
* @throws Exception
* - an exception that might occur during template to code generation
*/
public void generateJspFiles( MavenProject project, File jspSoureDirectory, Map<String, Object> variableMap )
throws Exception;

/**
* This method is used to format the java code base using Jalopy
*
* @param project
* the maven project reference
* @param packageName
* - the java package name
* @param className
* - the java class file
* @param javaFile
* - the File System location of the generated Java File
* @param content
* - the content of the Java class
* @param jalopySettings
* - Jalopy settings to use
* @throws Exception
* - any error that might occur during formatting
*/
public void formatJava(
MavenProject project, String packageName, String className, File javaFile, String content,
Map<String, Object> jalopySettings ) throws Exception;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/

package com.liferay.maven.plugins.components;

import java.util.Map;

/**
* The generic Template processor interface that will be implemented by spefic template processing engines to provide template based code generation
* @author kamesh.sampath
*/
public interface TemplateProcessor
{

String ROLE = TemplateProcessor.class.getName();

/**
* The method that will be used by the TemplateProcessor impementations to intialize and store the templates locally
*
* @throws Exception
* - any error that might occur during template inializations
*/
public void init() throws Exception;

/**
* The method that will do the actual processing of the templates, by substituting the values from the map
*
* @param templateName
* - the name of the template to process
* @param rootMap
* - the map of values which will be used as template data
* @return the string representation of the generated content
* @throws Exception
* - any error that might occur during processing
*/
public String processTemplate( String templateName, Map<String, Object> rootMap ) throws Exception;
}
Loading