Author: alexsmirnov
Date: 2009-07-24 19:45:04 -0400 (Fri, 24 Jul 2009)
New Revision: 15017
Removed:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/pom.xml
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenLogger.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCreateMojo.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyAttachedLibraryMojo.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateThemeMojo.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/mdo/resource-config.mdo
root/cdk/trunk/pom.xml
Log:
fix project build
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/pom.xml
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/pom.xml 2009-07-24 23:43:17 UTC (rev 15016)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/pom.xml 2009-07-24 23:45:04 UTC (rev 15017)
@@ -15,32 +15,32 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
- <version>2.0.4</version>
+ <version>2.0.10</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
- <version>2.0.4</version>
+ <version>2.0.10</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
- <version>2.0.4</version>
+ <version>2.0.10</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
- <version>2.2</version>
+ <version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>file-management</artifactId>
- <version>1.1</version>
+ <version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>1.5.1</version>
+ <version>1.5.15</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
@@ -50,7 +50,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>4.6</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -72,7 +72,7 @@
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
- <version>1.0-alpha-18</version>
+ <version>1.0.2</version>
<executions>
<execution>
<goals>
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenCompilationContext.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -25,9 +25,8 @@
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
-import org.richfaces.templatecompiler.builder.AbstractCompilationContext;
-import org.richfaces.templatecompiler.builder.CompilationException;
-import org.richfaces.templatecompiler.elements.ElementsFactory;
+import org.richfaces.cdk.AbstractCompilationContext;
+import org.richfaces.cdk.CdkException;
/**
* @author shura
@@ -42,7 +41,7 @@
* @param logger
* @throws CompilationException
*/
- public MavenCompilationContext(MavenLogger logger,ClassLoader loader,VelocityEngine
engine) throws CompilationException {
+ public MavenCompilationContext(MavenLogger logger,ClassLoader loader,VelocityEngine
engine) {
super(loader);
this.logger = logger;
this.engine = engine;
@@ -104,26 +103,19 @@
logger.warn(content, error);
}
- /* (non-Javadoc)
- * @see org.richfaces.templatecompiler.builder.CompilationContext#getElementsFactory()
- */
- public ElementsFactory getElementsFactory() {
- // TODO Auto-generated method stub
- return null;
- }
/* (non-Javadoc)
* @see
org.richfaces.templatecompiler.builder.CompilationContext#getTemplate(java.lang.String)
*/
- public Template getTemplate(String name) throws CompilationException {
+ public Template getTemplate(String name) throws CdkException {
try {
return engine.getTemplate(name);
} catch (ResourceNotFoundException e) {
- throw new CompilationException(e.getLocalizedMessage());
+ throw new CdkException(e.getLocalizedMessage());
} catch (ParseErrorException e) {
- throw new CompilationException(e.getLocalizedMessage());
+ throw new CdkException(e.getLocalizedMessage());
} catch (Exception e) {
- throw new CompilationException(e.getLocalizedMessage());
+ throw new CdkException(e.getLocalizedMessage());
}
}
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenLogger.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenLogger.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenLogger.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -22,7 +22,7 @@
package org.richfaces.builder.maven;
import org.apache.maven.plugin.logging.Log;
-import org.richfaces.builder.generator.Logger;
+import org.richfaces.cdk.Logger;
/**
* @author shura
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/maven/MavenXMLMerge.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -30,10 +30,9 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.codehaus.plexus.util.DirectoryScanner;
-import org.richfaces.builder.config.ParsingException;
-import org.richfaces.builder.xml.XMLBody;
-import org.richfaces.builder.xml.XMLBodyMerge;
-import org.richfaces.builder.xml.XPathComparator;
+import org.richfaces.cdk.xmlutils.XMLBody;
+import org.richfaces.cdk.xmlutils.XMLBodyMerge;
+import org.richfaces.cdk.xmlutils.XPathComparator;
/**
* Class is used to locate and merge several xml files
@@ -100,7 +99,7 @@
} catch (FileNotFoundException e) {
throw new MojoExecutionException("Could't read file "
+ sourceFile.getPath(), e);
- } catch (ParsingException e) {
+ } catch (org.richfaces.cdk.xmlutils.ParsingException e) {
throw new MojoExecutionException(
"Error parsing config file "
+ sourceFile.getPath(), e);
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCreateMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCreateMojo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AbstractCreateMojo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -25,9 +25,9 @@
import java.util.HashSet;
import java.util.Set;
-import org.aja4jsf.builder.model.Resource;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.velocity.VelocityContext;
+import org.richfaces.cdk.model.Resource;
/**
* @author Nick Belaevski
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyAttachedLibraryMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyAttachedLibraryMojo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyAttachedLibraryMojo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -58,11 +58,11 @@
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
import org.codehaus.plexus.util.DirectoryScanner;
-import org.richfaces.builder.config.ParsingException;
-import org.richfaces.builder.xml.NamesListComparator;
-import org.richfaces.builder.xml.XMLBody;
-import org.richfaces.builder.xml.XMLBodyMerge;
-import org.richfaces.builder.xml.XPathComparator;
+import org.richfaces.cdk.xmlutils.NamesListComparator;
+import org.richfaces.cdk.xmlutils.ParsingException;
+import org.richfaces.cdk.xmlutils.XMLBody;
+import org.richfaces.cdk.xmlutils.XMLBodyMerge;
+import org.richfaces.cdk.xmlutils.XPathComparator;
import org.w3c.dom.Node;
/**
@@ -423,7 +423,7 @@
} catch (FileNotFoundException e) {
throw new MojoExecutionException(
"Could't read faces-config file", e);
- } catch (ParsingException e) {
+ } catch (org.richfaces.cdk.xmlutils.ParsingException e) {
throw new MojoExecutionException(
"Error parsing faces-config file", e);
}
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/AssemblyLibraryMojo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -57,11 +57,11 @@
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
import org.codehaus.plexus.util.DirectoryScanner;
-import org.richfaces.builder.config.ParsingException;
-import org.richfaces.builder.xml.NamesListComparator;
-import org.richfaces.builder.xml.XMLBody;
-import org.richfaces.builder.xml.XMLBodyMerge;
-import org.richfaces.builder.xml.XPathComparator;
+import org.richfaces.cdk.xmlutils.NamesListComparator;
+import org.richfaces.cdk.xmlutils.ParsingException;
+import org.richfaces.cdk.xmlutils.XMLBody;
+import org.richfaces.cdk.xmlutils.XMLBodyMerge;
+import org.richfaces.cdk.xmlutils.XPathComparator;
import org.w3c.dom.Node;
/**
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CompileMojo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -21,6 +21,7 @@
package org.richfaces.builder.mojo;
+import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.io.File;
import java.lang.reflect.Array;
@@ -30,7 +31,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.commons.beanutils.PropertyUtils;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Parent;
import org.apache.maven.plugin.MojoExecutionException;
@@ -253,29 +253,29 @@
// All other objects threaded as Java Beans.
try {
StringBuffer ret = new StringBuffer("{");
- PropertyDescriptor[] propertyDescriptors = PropertyUtils
- .getPropertyDescriptors(obj);
+ PropertyDescriptor[] propertyDescriptors = Introspector
+ .getBeanInfo(obj.getClass()).getPropertyDescriptors();
boolean first = true;
for (int i = 0; i < propertyDescriptors.length; i++) {
PropertyDescriptor propertyDescriptor = propertyDescriptors[i];
String key = propertyDescriptor.getName();
- if ("class".equals(key)
- || propertyDescriptor.getReadMethod() == null) {
- continue;
+ if (!"class".equals(key)
+ && propertyDescriptor.getReadMethod() != null) {
+ if (!first) {
+ ret.append(",\n\t");
+ }
+ addEncodedString(ret, key);
+ ret.append(":");
+ try {
+ Object value = propertyDescriptor.getReadMethod()
+ .invoke(obj, new Object[] {});
+ propertyDescriptor.getReadMethod();
+ ret.append(String.valueOf(value));
+ } catch (InvocationTargetException e) {
+ ret.append("null");
+ }// ret.append(toLog(PropertyUtils.getProperty(obj, key)));
+ first = false;
}
- if (!first) {
- ret.append(",\n\t");
- }
- addEncodedString(ret, key);
- ret.append(":");
- try {
- ret.append(String.valueOf(PropertyUtils.getProperty(obj,
- key)));
-
- } catch (InvocationTargetException e) {
- ret.append("Not ACCESIBLE");
- }// ret.append(toLog(PropertyUtils.getProperty(obj, key)));
- first = false;
}
return ret.append("}\n").toString();
} catch (Exception e) {
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateSkinMojo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -33,10 +33,6 @@
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
-import org.aja4jsf.builder.model.Resource;
-import org.aja4jsf.builder.model.ResourceConfig;
-import org.aja4jsf.builder.model.io.xpp3.ResourceConfigXpp3Reader;
-import org.aja4jsf.builder.model.io.xpp3.ResourceConfigXpp3Writer;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
@@ -44,6 +40,10 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.velocity.VelocityContext;
+import org.richfaces.cdk.model.Resource;
+import org.richfaces.cdk.model.ResourceConfig;
+import org.richfaces.cdk.model.io.xpp3.ResourceConfigXpp3Reader;
+import org.richfaces.cdk.model.io.xpp3.ResourceConfigXpp3Writer;
/**
* This mojo is intended to create new skin add-on within existing project.
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateThemeMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateThemeMojo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/CreateThemeMojo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -24,10 +24,10 @@
import java.io.File;
import java.util.Locale;
-import org.aja4jsf.builder.model.Resource;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.velocity.VelocityContext;
+import org.richfaces.cdk.model.Resource;
/**
* This mojo is intended to create new theme within existing project.
Deleted:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -1,339 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * 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.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.builder.mojo;
-
-import java.io.File;
-import java.io.FilenameFilter;
-
-import org.apache.maven.model.Resource;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.velocity.Template;
-import org.apache.velocity.exception.ParseErrorException;
-import org.apache.velocity.exception.ResourceNotFoundException;
-import org.richfaces.builder.config.BuilderConfig;
-import org.richfaces.builder.config.ParsingException;
-import org.richfaces.builder.generator.ComponentGenerator2;
-import org.richfaces.builder.generator.ComponentTagGenerator;
-import org.richfaces.builder.generator.ConverterGenerator;
-import org.richfaces.builder.generator.ConverterTagGenerator;
-import org.richfaces.builder.generator.FaceletsTaglibGenerator;
-import org.richfaces.builder.generator.FacesConfigGenerator;
-import org.richfaces.builder.generator.GeneratorException;
-import org.richfaces.builder.generator.JSFGeneratorConfiguration;
-import org.richfaces.builder.generator.ListenerGenerator;
-import org.richfaces.builder.generator.ListenerTagGenerator;
-import org.richfaces.builder.generator.RenderKitBean;
-import org.richfaces.builder.generator.RendererGenerator;
-import org.richfaces.builder.generator.ResourcesConfigGenerator;
-import org.richfaces.builder.generator.ResourcesConfigParser;
-import org.richfaces.builder.generator.ResourcesDependenciesGenerator;
-import org.richfaces.builder.generator.TagHandlerGenerator;
-import org.richfaces.builder.generator.TaglibGenerator;
-import org.richfaces.builder.generator.ValidatorGenerator;
-import org.richfaces.builder.generator.ValidatorTagGenerator;
-import org.richfaces.builder.maven.MavenLogger;
-import org.richfaces.builder.velocity.BuilderContext;
-
-/**
- * This plugin geterate JSF components and renderers source code, as well as
- * configuration files.
- *
- * @author shura
- * @goal generate
- * @requiresDependencyResolution compile
- * @phase generate-sources
- * @execute phase="compile"
- */
-public class GenerateMojo extends AbstractCDKMojo implements
- JSFGeneratorConfiguration {
-
- /**
- * Project executed by first compile lifecycle.
- *
- * @parameter expression="${executedProject}"
- * @readonly
- */
- protected MavenProject executedProject;
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.maven.plugin.Mojo#execute()
- */
- public void execute() throws MojoExecutionException, MojoFailureException {
- getLog().debug("GenerateMojo components");
-
- //FIXME: configure plexus component instead of programmatic property set.
-
- // velocity.getEngine().setProperty("velocimacro.library",
getTemplatesPath() + "/VM_global_library.vm");
-
- if (null != executedProject) {
- Taglib taglib = checkLibraryConfig();
- ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
- // compile goal executed
- try {
- // Parse config files.
- ClassLoader generatiorLoader = createProjectClassLoader(executedProject);
- Thread.currentThread().setContextClassLoader(generatiorLoader);
- BuilderConfig config = createConfig(generatiorLoader);
- MavenLogger mavenLogger = new MavenLogger(getLog());
- // TODO - parse sources by qdox for JavaDoc comments ?
- // GenerateMojo components.
- ComponentGenerator2 compGenerator = new ComponentGenerator2(this,
- mavenLogger);
- compGenerator.createFiles(config);
- // GenerateMojo validators
- ValidatorGenerator validatorGenerator = new ValidatorGenerator(this, mavenLogger);
- validatorGenerator.createFiles(config);
- // GenerateMojo converters
- ConverterGenerator converterGenerator = new ConverterGenerator(this, mavenLogger);
- converterGenerator.createFiles(config);
- // GenerateMojo renderers
- RendererGenerator rendererGenerator = new RendererGenerator(
- this, mavenLogger);
- rendererGenerator.setSrcDir(templatesDirectory);
- rendererGenerator.createFiles(config);
- // GenerateMojo component test
-/*
- ComponentTestGenerator componentTestGenerator = new ComponentTestGenerator(this,
mavenLogger);
- componentTestGenerator.setDestDir(outputTestsDirectory);
- componentTestGenerator.createFiles(config);
-*/
- // GenerateMojo tags
- ComponentTagGenerator componentTagGenerator = new ComponentTagGenerator(this,
mavenLogger);
- componentTagGenerator.createFiles(config);
-
-// GenerateMojo tags for validators
- ValidatorTagGenerator validatorTagGenerator = new ValidatorTagGenerator(this,
mavenLogger);
- validatorTagGenerator.createFiles(config);
-
-// GenerateMojo tags for converters
- ConverterTagGenerator converterTagGenerator = new ConverterTagGenerator(this,
mavenLogger);
- converterTagGenerator.createFiles(config);
-
-
- ListenerTagGenerator listenerTagGenerator = new ListenerTagGenerator(this,
mavenLogger);
- listenerTagGenerator.createFiles(config);
-
-
- // GenerateMojo tag test
-/*
- TagTestGenerator tagTestGenerator = new TagTestGenerator(this, mavenLogger);
- tagTestGenerator.setDestDir(outputTestsDirectory);
- tagTestGenerator.createFiles(config);
-*/
- // GenerateMojo tag handlers
- TagHandlerGenerator tagHandlerGenerator = new TagHandlerGenerator(
- this, mavenLogger);
- tagHandlerGenerator.createFiles(config);
- //Generate listeners
- ListenerGenerator listenerGenerator = new ListenerGenerator(this, mavenLogger);
- listenerGenerator.createFiles(config);
-
- JSFGeneratorConfiguration resourcesConfiguration = new JSFGeneratorConfiguration() {
-
- public ClassLoader getClassLoader() {
- return createProjectClassLoader(executedProject);
- }
-
- public File getDestDir() {
- return outputResourcesDirectory;
- }
-
- public String getKey() {
- return key;
- }
-
- public Template getTemplate(String name) throws GeneratorException {
- return GenerateMojo.this.getTemplate(name);
- }
-
- public String getTemplatesPath() {
- return GenerateMojo.this.getTemplatesPath();
- }
-
- };
- // GenerateMojo faces-config
- FacesConfigGenerator configGenerator = new FacesConfigGenerator(
- resourcesConfiguration, mavenLogger);
- configGenerator.setInclude(facesConfigInclude);
- configGenerator.setFacesconfig(new File(
- outputResourcesDirectory, "META-INF/faces-config.xml"));
- RenderKitBean renderKitBean = configGenerator.createRenderKit();
- renderKitBean.setRenderkitid("HTML_BASIC");
- configGenerator.createFiles(config);
- // GenerateMojo JSP taglib
- if (null != taglib) {
- TaglibGenerator taglibGenerator = new TaglibGenerator(
- resourcesConfiguration, mavenLogger);
- taglibGenerator.setUri(taglib.getUri());
- taglibGenerator.setShortname(taglib.getShortName());
- taglibGenerator.setListenerclass(taglib.getListenerClass());
- taglibGenerator.setDisplayname(taglib.getDisplayName());
- taglibGenerator.setListenerclass(taglib.getListenerClass());
- taglibGenerator.setValidatorclass(taglib.getValidatorClass());
- taglibGenerator.setTlibversion(taglib.getTlibVersion());
- taglibGenerator.setJspversion(taglib.getJspVersion());
- taglibGenerator.setInclude(taglibInclude);
- taglibGenerator.setTaglib(new File(
- outputResourcesDirectory, "META-INF/"+taglib.getShortName()
- + ".tld"));
- taglibGenerator.createFiles(config);
- // GenerateMojo Facelets taglib
- FaceletsTaglibGenerator faceletsTaglibGenerator = new FaceletsTaglibGenerator(
- resourcesConfiguration, mavenLogger);
- faceletsTaglibGenerator.setUri(taglib.getUri());
- faceletsTaglibGenerator.setShortname(taglib.getShortName());
- faceletsTaglibGenerator.setInclude(taglibInclude);
- faceletsTaglibGenerator.setTaglib(new File(
- outputResourcesDirectory, "META-INF/"+taglib.getShortName()
- + ".taglib.xml"));
- faceletsTaglibGenerator.createFiles(config);
- }
-
- ResourcesConfigParser resourcesConfigParser = new
ResourcesConfigParser(resourcesConfiguration, mavenLogger);
- resourcesConfigParser.setTemplates(templatesDirectory);
- resourcesConfigParser.parse(config);
-
- if (taglib != null) {
- ResourcesDependenciesGenerator resourcesDependenciesGenerator = new
ResourcesDependenciesGenerator(resourcesConfiguration, mavenLogger);
- resourcesDependenciesGenerator.setUri(taglib.getUri());
- resourcesDependenciesGenerator.setDependencyFile(new File(outputResourcesDirectory,
- "META-INF/" + taglib.getShortName() +
".component-dependencies.xml"));
- resourcesDependenciesGenerator.setComponentDependencies(resourcesConfigParser.getComponentResourcesMap());
- resourcesDependenciesGenerator.createFiles(config);
- }
-
- // Generate resources configuration file resources-config.xml
- // for all images/scripts/css...
- ResourcesConfigGenerator resourcesConfigGenerator = new
ResourcesConfigGenerator(resourcesConfiguration, mavenLogger);
- resourcesConfigGenerator.setResourcesConfigGeneratorBean(resourcesConfigParser.getResourcesConfigGeneratorBean());
- resourcesConfigGenerator.setInclude(resourcesInclude);
- resourcesConfigGenerator.setTemplates(templatesDirectory);
- resourcesConfigGenerator.setResourcesConfig(new File(
- outputResourcesDirectory, "META-INF/resources-config.xml"));
- resourcesConfigGenerator.createFiles(config);
-
- // Add generated sources and resources to project
- project.addCompileSourceRoot(outputJavaDirectory.getPath());
-// project.addCompileSourceRoot(outputTestsDirectory.getPath());
-
- Resource resource = new Resource();
- resource.setDirectory(outputResourcesDirectory.getPath());
-// resource.setTargetPath("META-INF");
- project.addResource(resource);
- } catch (Exception e) {
- getLog().error("Error on generate component", e);
- throw new MojoExecutionException(
- "Error in component generation", e);
- }
- Thread.currentThread().setContextClassLoader(contextCL);
- }
-
- }
-
- protected BuilderConfig createConfig(ClassLoader generatiorLoader)
- throws ParsingException {
- BuilderConfig builderConfig = new BuilderConfig(generatiorLoader,
- new MavenLogger(getLog()));
- // Get all *.xml config files
- FilenameFilter filter = new FilenameFilter() {
-
- public boolean accept(File dir, String name) {
-
- return name.toLowerCase().endsWith(".xml");
- }
-
- };
- boolean filesParsed = false;
- File [] directories = {
- componentConfigDirectory,
- validatorConfigDirectory,
- converterConfigDirectory
- };
-
- for (File directory : directories) {
- if (directory.exists()) {
- File[] files = directory.listFiles(filter);
- for (File file : files) {
- filesParsed = true;
- builderConfig.parseConfig(file);
- }
- }
- }
- if (!filesParsed) {
- getLog().warn("No component configuration files found -- probably a skin
project");
- }
- /*
- if (!filesParsed) {
- throw new ParsingException("No config files found");
- }
- */
- builderConfig.checkComponentProperties();
- return builderConfig;
- }
-
- public File getDestDir() {
- // TODO Auto-generated method stub
- return outputJavaDirectory;
- }
-
- public String getKey() {
- // TODO Auto-generated method stub
- return key;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.builder.generator.JSFGeneratorConfiguration#getClassLoader()
- */
- public ClassLoader getClassLoader() {
- return createProjectClassLoader(executedProject);
- }
-
- /* (non-Javadoc)
- * @see
org.richfaces.builder.generator.JSFGeneratorConfiguration#getTemplate(java.lang.String)
- */
- public Template getTemplate(String name) throws GeneratorException {
- // TODO Auto-generated method stub
- try {
- return this.velocity.getEngine().getTemplate(name);
- } catch (ResourceNotFoundException e) {
- throw new GeneratorException(e.getLocalizedMessage());
- } catch (ParseErrorException e) {
- throw new GeneratorException(e.getLocalizedMessage());
- } catch (Exception e) {
- throw new GeneratorException(e.getLocalizedMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.builder.generator.JSFGeneratorConfiguration#getTemplatesPath()
- */
- public String getTemplatesPath() {
- return
Library.JSF12.equals(library.getJsfVersion())?BuilderContext.TEMPLATES12_PATH:BuilderContext.TEMPLATES_PATH;
- }
-
-}
Deleted:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateTestMojo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -1,171 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * 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.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.builder.mojo;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.richfaces.builder.config.BuilderConfig;
-import org.richfaces.builder.generator.ComponentTestGenerator;
-import org.richfaces.builder.generator.TagTestGenerator;
-import org.richfaces.builder.maven.MavenLogger;
-
-/**
- *
- * @author dbiatenia
- * @goal generate-tests
- * @requiresDependencyResolution test
- * @phase generate-test-sources
- * @execute phase="test-compile"
- */
-public class GenerateTestMojo extends GenerateMojo{
-
- public void execute() throws MojoExecutionException, MojoFailureException {
- getLog().debug("GenerateTestMojo tests");
- if (null != executedProject) {
- Taglib taglib = checkLibraryConfig();
- // compile goal executed
- try {
- // Parse config files.
- ClassLoader generatiorLoader = createProjectClassLoader(executedProject);
- BuilderConfig config = createConfig(generatiorLoader);
- MavenLogger mavenLogger = new MavenLogger(getLog());
- // TODO - parse sources by qdox for JavaDoc comments ?
- // GenerateMojo components.
-/*
- ComponentGenerator compGenerator = new ComponentGenerator(this,
- mavenLogger);
- compGenerator.createFiles(config);
-*/
- // GenerateMojo renderers
-/*
- RendererGenerator rendererGenerator = new RendererGenerator(
- this, mavenLogger);
- rendererGenerator.setSrcDir(templatesDirectory);
- rendererGenerator.createFiles(config);
-*/
- // GenerateMojo component test
- ComponentTestGenerator componentTestGenerator = new ComponentTestGenerator(this,
mavenLogger);
- componentTestGenerator.setDestDir(outputTestsDirectory);
- componentTestGenerator.createFiles(config);
-
- // GenerateMojo tags
-/*
- TagGenerator tagGenerator = new TagGenerator(this, mavenLogger);
- tagGenerator.createFiles(config);
-*/
- // GenerateMojo tag test
- TagTestGenerator tagTestGenerator = new TagTestGenerator(this, mavenLogger);
- tagTestGenerator.setDestDir(outputTestsDirectory);
- tagTestGenerator.createFiles(config);
-
- // GenerateMojo tag handlers
-/*
- TagHandlerGenerator tagHandlerGenerator = new TagHandlerGenerator(
- this, mavenLogger);
- tagHandlerGenerator.createFiles(config);
- //Generate listeners
- ListenerGenerator listenerGenerator = new ListenerGenerator(this, mavenLogger);
- listenerGenerator.createFiles(config);
-*/
-/*
- JSFGeneratorConfiguration resourcesConfiguration = new JSFGeneratorConfiguration() {
-
- public ClassLoader getClassLoader() {
- return createProjectClassLoader(executedProject);
- }
-
- public File getDestDir() {
- return outputResourcesDirectory;
- }
-
- public String getKey() {
- return key;
- }
-
- public Template getTemplate(String name) throws GeneratorException {
- return GenerateTestMojo.this.getTemplate(name);
- }
-
- public String getTemplatesPath() {
- return GenerateTestMojo.this.getTemplatesPath();
- }
-
- };
- // GenerateMojo faces-config
- FacesConfigGenerator configGenerator = new FacesConfigGenerator(
- resourcesConfiguration, mavenLogger);
- configGenerator.setInclude(facesConfigInclude);
- configGenerator.setFacesconfig(new File(
- outputResourcesDirectory, "META-INF/faces-config.xml"));
- RenderKitBean renderKitBean = configGenerator.createRenderKit();
- renderKitBean.setRenderkitid("HTML_BASIC");
- configGenerator.createFiles(config);
- // GenerateMojo JSP taglib
- if (null != taglib) {
- TaglibGenerator taglibGenerator = new TaglibGenerator(
- resourcesConfiguration, mavenLogger);
- taglibGenerator.setUri(taglib.getUri());
- taglibGenerator.setShortname(taglib.getShortName());
- taglibGenerator.setListenerclass(taglib.getListenerClass());
- taglibGenerator.setDisplayname(taglib.getDisplayName());
- taglibGenerator.setListenerclass(taglib.getListenerClass());
- taglibGenerator.setValidatorclass(taglib.getValidatorClass());
- taglibGenerator.setTlibversion(taglib.getTlibVersion());
- taglibGenerator.setJspversion(taglib.getJspVersion());
- taglibGenerator.setInclude(taglibInclude);
- taglibGenerator.setTaglib(new File(
- outputResourcesDirectory, "META-INF/"+taglib.getShortName()
- + ".tld"));
- taglibGenerator.createFiles(config);
- // GenerateMojo Facelets taglib
- FaceletsTaglibGenerator faceletsTaglibGenerator = new FaceletsTaglibGenerator(
- resourcesConfiguration, mavenLogger);
- faceletsTaglibGenerator.setUri(taglib.getUri());
- faceletsTaglibGenerator.setShortname(taglib.getShortName());
- faceletsTaglibGenerator.setInclude(taglibInclude);
- faceletsTaglibGenerator.setTaglib(new File(
- outputResourcesDirectory, "META-INF/"+taglib.getShortName()
- + ".taglib.xml"));
- faceletsTaglibGenerator.createFiles(config);
- }
- // Generate resources configuration file resources-config.xml
- // for all images/scripts/css...
- // Add generated sources and resources to project
-*/
-// project.addCompileSourceRoot(outputJavaDirectory.getPath());
- project.addTestCompileSourceRoot(outputTestsDirectory.getPath());
-/*
- Resource resource = new Resource();
- resource.setDirectory(outputResourcesDirectory.getPath());
-// resource.setTargetPath("META-INF");
- project.addResource(resource);
-*/
- } catch (Exception e) {
- getLog().error("Error on generate component", e);
- throw new MojoExecutionException(
- "Error in component generation", e);
- }
- }
-
- }
-
-}
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java
===================================================================
---
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java 2009-07-24
23:43:17 UTC (rev 15016)
+++
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/SkinInfo.java 2009-07-24
23:45:04 UTC (rev 15017)
@@ -24,7 +24,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.aja4jsf.builder.model.Resource;
+import org.richfaces.cdk.model.Resource;
/**
* @author Maksim Kaszynski
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/mdo/resource-config.mdo
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/mdo/resource-config.mdo 2009-07-24
23:43:17 UTC (rev 15016)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/mdo/resource-config.mdo 2009-07-24
23:45:04 UTC (rev 15017)
@@ -5,7 +5,7 @@
<defaults>
<default>
<key>package</key>
- <value>org.aja4jsf.builder.model</value>
+ <value>org.richfaces.cdk.model</value>
</default>
</defaults>
<classes>
Modified: root/cdk/trunk/pom.xml
===================================================================
--- root/cdk/trunk/pom.xml 2009-07-24 23:43:17 UTC (rev 15016)
+++ root/cdk/trunk/pom.xml 2009-07-24 23:45:04 UTC (rev 15017)
@@ -29,6 +29,63 @@
<url>file:target/site2</url>
</site-->
</distributionManagement>
+ <repositories>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <id>maven-repository2.dev.java.net</id>
+ <
name>Java.net Repository for Maven 2</name>
+ <
url>http://download.java.net/maven/2</url>
+ </repository>
+
+ <repository>
+ <id>repository.jboss.org</id>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <
url>http://repository.jboss.org/maven2</url>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <
url>http://snapshots.jboss.org/maven2</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <
url>http://repository.jboss.org/maven2</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>snapshots.jboss.org</id>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <
url>http://snapshots.jboss.org/maven2</url>
+ </pluginRepository>
+ </pluginRepositories>
+
<modules>
<module>plugins</module>
<module>archetypes</module>