dev@javaserverfaces.java.net

Re: call for review for JAVASERVERFACES-3368

From: manfred riem <manfred.riem_at_oracle.com>
Date: Wed, 27 Aug 2014 09:37:45 -0500

Hi Zhijun,

Because this code is only meant for generation purposes and the plugins
themselves have a specific task at hand please go ahead and copy the
code into the plugin, but only the code that is in play for the specific
plugin you are targetting.

Regards,
Manfred

On 8/27/14, 1:07 AM, zhijun Ren wrote:
> Hi Manfred,
>
> Thanks for the comments.
>
> For 2, I think copying tools sources to separate plugins cause code
> level duplication. In future, if there is bug in tools code, it is
> hard to resolve and test, do you agree? My opinion is the tools jar
> file should be installed in the local repository ahead.
>
> BR,
> Zhijun
>
> On 8/27/14, 1:04, manfred riem wrote:
>> Hi Zhijun,
>>
>> 1. Please rename plugin to html-components-plugin.
>>
>> 2. Please copy the sources from
>> jsf-tools/src/main/java/com/sun/faces/generate into the plugin project.
>>
>> 3. Please remove the src/main/resources directory from the plugin as
>> this should be pulled in using a configuration on the plugin.
>>
>> You are doing great work. We will slowly get to the point where the
>> plugin will do exactly what we need!
>>
>> Thanks!
>> Manfred
>>
>>
>> On 8/14/14, 4:08 AM, zhijun Ren wrote:
>>> Hi Manfred and Ed,
>>>
>>> Thanks for your comments, I have fixed them except item 3:
>>>
>>> 1. The plugin needs to be self contained (copy the code from
>>> jsf-tools that is needed for this).
>>> [Zhijun] fixed, modified some code in jsf-tools for this, some files
>>> need to be looked up in the jar file as resources.
>>> 2. The plugin source code needs to live in
>>> com.sun.faces.maven.plugins.XXXX
>>> [Zhijun] fixed.
>>> 3. The plugin needs to be automatically run in the generate-sources
>>> phase
>>> [Zhijun] should be configured in the project who will call this
>>> plugin, right?
>>> 4. The plugin will need to be put into the
>>> $WORKSPACE/maven/plugins/XXXX directory (where $WORKSPACE is the
>>> directory where you have the Mojarra source code checked out).
>>> [Zhijun] fixed.
>>>
>>> Attach the updated change bundle here for your check, thanks for
>>> your further comments.
>>>
>>> The tester maven project changed a little:
>>>
>>> /<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>com.ren.app</groupId>
>>> <artifactId>test-plugin</artifactId>
>>> <packaging>war</packaging>
>>> <version>1.0-SNAPSHOT</version>
>>> <name>test-plugin Maven Webapp</name>
>>> <url>http://maven.apache.org</url>
>>> <dependencies>
>>> <dependency>
>>> <groupId>junit</groupId>
>>> <artifactId>junit</artifactId>
>>> <version>3.8.1</version>
>>> <scope>test</scope>
>>> </dependency>
>>> </dependencies>
>>> <build>
>>> <finalName>test-plugin</finalName>
>>> <plugins>
>>> <plugin>
>>> <groupId>com.sun.faces.maven.plugins</groupId>
>>> <artifactId>compogen-maven-plugin</artifactId>
>>> <version>2.2.8-SNAPSHOT</version>
>>> <executions>
>>> <execution>
>>> <phase>compile</phase>
>>> <goals>
>>> <goal>CompoGen</goal>
>>> </goals>
>>> </execution>
>>> </executions>
>>> </plugin>
>>> </plugins>
>>> </build>
>>> </project>/
>>>
>>>
>>> BR,
>>> Zhijun
>>>
>>>
>>>
>>> On 8/14/14, 0:00, manfred riem wrote:
>>>> Hi Zhijun,
>>>>
>>>> Great first cut! Let me add some extra notes so you are aware what
>>>> we need in the end.
>>>>
>>>> 1. The plugin needs to be self contained (copy the code from
>>>> jsf-tools that is needed for this).
>>>> 2. The plugin source code needs to live in
>>>> com.sun.faces.maven.plugins.XXXX
>>>> 3. The plugin needs to be automatically run in the generate-sources
>>>> phase
>>>> 4. The plugin will need to be put into the
>>>> $WORKSPACE/maven/plugins/XXXX directory (where $WORKSPACE is the
>>>> directory where you have the Mojarra source code checked out).
>>>>
>>>> Thanks!
>>>> Manfred
>>>>
>>>> On 8/13/14, 3:46 AM, zhijun Ren wrote:
>>>>> Hi Ed and Manfred,
>>>>>
>>>>> I just completed to develop a first version of the plugin for
>>>>> generating the html components, please help to review mainly from
>>>>> the perspective of solution and folder structure to ensure my
>>>>> direction is correct. I still need to refine it, e.g.,
>>>>> parameterize the target folder etc.
>>>>>
>>>>> Attach the change bundle and new files here for your reference.
>>>>>
>>>>> It works fine in the testing by the command "mvn
>>>>> compogen:CompoGen" on the following maven project: ( Q: do I also
>>>>> need to commit a test project for this plugin? )
>>>>>
>>>>> /<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>com.ren.app</groupId>
>>>>> <artifactId>test-plugin</artifactId>
>>>>> <packaging>war</packaging>
>>>>> <version>1.0-SNAPSHOT</version>
>>>>> <name>test-plugin Maven Webapp</name>
>>>>> <url>http://maven.apache.org</url>
>>>>> <dependencies>
>>>>> <dependency>
>>>>> <groupId>junit</groupId>
>>>>> <artifactId>junit</artifactId>
>>>>> <version>3.8.1</version>
>>>>> <scope>test</scope>
>>>>> </dependency>
>>>>> </dependencies>
>>>>> <build>
>>>>> <finalName>test-plugin</finalName>
>>>>> <plugins>
>>>>> <plugin>
>>>>> <groupId>com.sun.faces.build.plugins</groupId>
>>>>> <artifactId>compogen-maven-plugin</artifactId>
>>>>> <version>2.2.8-SNAPSHOT</version>
>>>>> <configuration>
>>>>> <jsfBuildHome>/Users/zhijun/mojarra/MOJARRA_2_2X_ROLLING</jsfBuildHome>
>>>>> </configuration>
>>>>> <executions>
>>>>> <execution>
>>>>> <phase>compile</phase>
>>>>> <goals>
>>>>> <goal>CompoGen</goal>
>>>>> </goals>
>>>>> </execution>
>>>>> </executions>
>>>>> </plugin>
>>>>> </plugins>
>>>>> </build>
>>>>> </project>
>>>>> /
>>>>>
>>>>> BR,
>>>>> Zhijun