You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Ted Husted <hu...@apache.org> on 2006/09/06 13:41:50 UTC

[s2] Source with examples

I tried to update the S2 apps POM to bundle the source, as we do with
the S1 apps, but it didn't seem to work.

----

...

        </plugin>
         <!-- Include source code under WEB-INF/src/java -->
         <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
               <execution>
                  <id>copy-sources</id>
                  <phase>process-sources</phase>
                  <configuration>
                     <tasks>
                        <copy
todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
                              failonerror="false">
                           <fileset dir="${basedir}/src/main/java"/>
                        </copy>
                     </tasks>
                  </configuration>
                  <goals>
                     <goal>run</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
     </plugins>
  </build>

....

----

Is there something else we need to do?

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by Ted Husted <hu...@apache.org>.
On 9/7/06, Wendy Smoak <ws...@gmail.com> wrote:
> On 9/7/06, Ted Husted <hu...@apache.org> wrote:
>
> > If you have it working on your local copy, could you check it in?
> >
> > Distributing the example applications without the source is pointless,
> > so we do want this change made in the repository.
>
> I found the problem.  The <plugin> section where we execute
> maven-antrun-plugin was _inside_ the 'hostedqa' profile.  It's fixed
> in r441357.

Thanks, Wendy. With the source code in the applications, I think we're
good to go on a tagged 2.0.0 distribution, and I'll try to do that
tonight.


> The 'portlet' app needs to be looked at.  The contents of
> WEB-INF/classes differs from WEB-INF/src/java after we do the copying,
> so something might be missing.

I've been meaning to look at the portlet integration. I wonder if
that's something that could be an extra, or is it tightly woven into
things. Log messages that say things like "Portlet support is
disabled" get dull after a while if you're not doing portlets.

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by Wendy Smoak <ws...@gmail.com>.
On 9/7/06, Ted Husted <hu...@apache.org> wrote:

> If you have it working on your local copy, could you check it in?
>
> Distributing the example applications without the source is pointless,
> so we do want this change made in the repository.

I found the problem.  The <plugin> section where we execute
maven-antrun-plugin was _inside_ the 'hostedqa' profile.  It's fixed
in r441357.

The 'portlet' app needs to be looked at.  The contents of
WEB-INF/classes differs from WEB-INF/src/java after we do the copying,
so something might be missing.

And James pointed out that the pom artifactId I've been talking about
is actually 'struts2-apps', not 'struts2-apps-parent'.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by James Mitchell <jm...@apache.org>.
I think Wendy is calling it -parent because that is normally the  
convention, but our 'apps parent' for both struts1 and struts2 is at  
the root of apps/.



[jmitchell@198 ~/svn]$ cd struts/struts2/apps/

[jmitchell@198 ~/svn/struts/struts2/apps]$ ls -l
total 16
drwx------    9 jmitchel  jmitchel   306 Sep  6 20:35 blank
drwxr-xr-x    9 jmitchel  jmitchel   306 Sep  6 20:35 mailreader
-rw-r--r--    1 jmitchel  jmitchel  7446 Sep  6 20:35 pom.xml
drwx------    9 jmitchel  jmitchel   306 Aug 31 14:07 portlet
drwx------    5 jmitchel  jmitchel   170 Aug 29 23:18 shopping-cart
drwx------   10 jmitchel  jmitchel   340 Sep  6 20:35 showcase
drwx------    5 jmitchel  jmitchel   170 Sep  6 20:34 starter

[jmitchell@198 ~/svn/struts/struts2/apps]$ mvn install -N
[INFO] Scanning for projects...
[INFO]  
------------------------------------------------------------------------ 
----
[INFO] Building Webapps
[INFO]    task-segment: [install]
[INFO]  
------------------------------------------------------------------------ 
----
[INFO] Skipping missing optional mojo: org.apache.maven.plugins:maven- 
site-plugin:attach-descriptor
[INFO] [install:install]
[INFO] Installing /Users/jmitchell/svn/struts/struts2/apps/pom.xml  
to /Users/jmitchell/.m2/repository/org/apache/struts/struts2-apps/ 
2.0.0-SNAPSHOT/struts2-apps-2.0.0-SNAPSHOT.pom
[INFO]  
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]  
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Thu Sep 07 08:03:28 EDT 2006
[INFO] Final Memory: 3M/5M
[INFO]  
------------------------------------------------------------------------




--
James Mitchell
678.910.8017




On Sep 7, 2006, at 7:15 AM, Ted Husted wrote:

> On 9/6/06, Wendy Smoak <ws...@gmail.com> wrote:
>> On 9/6/06, Ted Husted <hu...@apache.org> wrote:
>>
>> > It didn't show my changes. I'm not sure if it's showing anything  
>> from
>> > the POM under apps.
>> >
>> > If I move the changes down to the blank POM, it works just fine.
>>
>> I pasted the copy-sources config into struts-apps-parent, and then
>> from struts2/apps/blank, ran 'mvn install'.
>>
>> I specifically did not install the struts-apps-parent pom, just to  
>> see
>> whether Maven would pick up the changes from the filesystem w/o
>> installing it.
>
> Hmmm, I don't know what "install the struts-apps-parent pom" means.
>
> By "struts-apps-parent" do you mean this one:
>
> * http://svn.apache.org/viewvc/struts/struts2/trunk/apps/pom.xml
>
> If you have it working on your local copy, could you check it in?
>
> Distributing the example applications without the source is pointless,
> so we do want this change made in the repository.
>
> -Ted.
>
>
>
>>
>> It's working fine here, both from 'apps/blank' and from 'apps'.
>>
>> $ pwd
>> /cygdrive/c/svn/struts/current/struts2/apps/blank
>>
>> $ mvn install
>> ...
>> $ ls -R target/struts2-blank/WEB-INF/src
>> target/struts2-blank/WEB-INF/src:
>> java
>>
>> target/struts2-blank/WEB-INF/src/java:
>> example
>>
>> target/struts2-blank/WEB-INF/src/java/example:
>> ExampleSupport.java  HelloWorld.java  Login.java
>>
>> This will wrap, but just so we're sure we're both using the same  
>> config:
>>
>> $ svn diff
>> Index: pom.xml
>> ===================================================================
>> --- pom.xml     (revision 440812)
>> +++ pom.xml     (working copy)
>> @@ -142,6 +142,26 @@
>>                      </configuration>
>>                  </configuration>
>>              </plugin>
>> +                     <plugin>
>> +            <artifactId>maven-antrun-plugin</artifactId>
>> +            <executions>
>> +               <execution>
>> +                  <id>copy-sources</id>
>> +                  <phase>process-sources</phase>
>> +                  <configuration>
>> +                     <tasks>
>> +                        <copy
>> todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
>> +                              failonerror="false">
>> +                           <fileset dir="${basedir}/src/main/java"/>
>> +                        </copy>
>> +                     </tasks>
>> +                  </configuration>
>> +                  <goals>
>> +                     <goal>run</goal>
>> +                  </goals>
>> +               </execution>
>> +            </executions>
>> +         </plugin>
>>          </plugins>
>>
>>          <finalName>${pom.artifactId}</finalName>
>>
>> Then I tried building all the apps from struts2/apps:
>>
>> $ pwd
>> /cygdrive/c/svn/struts/current/struts2/apps
>>
>> $ mvn clean; mvn install
>> ...
>>
>> $ ls -R blank/target/struts2-blank/WEB-INF/src
>> blank/target/struts2-blank/WEB-INF/src:
>> java
>>
>> blank/target/struts2-blank/WEB-INF/src/java:
>> example
>>
>> blank/target/struts2-blank/WEB-INF/src/java/example:
>> ExampleSupport.java  HelloWorld.java  Login.java
>>
>> I don't know why it isn't working for you from 'apps', but if you can
>> get it to work by duplicating the config in each of the example apps'
>> poms, I'd just do that, with a comment so we can fix it later.
>>
>> --
>> Wendy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>
> -- 
> HTH, Ted.
> * http://www.husted.com/struts/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by Ted Husted <hu...@apache.org>.
On 9/6/06, Wendy Smoak <ws...@gmail.com> wrote:
> On 9/6/06, Ted Husted <hu...@apache.org> wrote:
>
> > It didn't show my changes. I'm not sure if it's showing anything from
> > the POM under apps.
> >
> > If I move the changes down to the blank POM, it works just fine.
>
> I pasted the copy-sources config into struts-apps-parent, and then
> from struts2/apps/blank, ran 'mvn install'.
>
> I specifically did not install the struts-apps-parent pom, just to see
> whether Maven would pick up the changes from the filesystem w/o
> installing it.

Hmmm, I don't know what "install the struts-apps-parent pom" means.

By "struts-apps-parent" do you mean this one:

* http://svn.apache.org/viewvc/struts/struts2/trunk/apps/pom.xml

If you have it working on your local copy, could you check it in?

Distributing the example applications without the source is pointless,
so we do want this change made in the repository.

-Ted.



>
> It's working fine here, both from 'apps/blank' and from 'apps'.
>
> $ pwd
> /cygdrive/c/svn/struts/current/struts2/apps/blank
>
> $ mvn install
> ...
> $ ls -R target/struts2-blank/WEB-INF/src
> target/struts2-blank/WEB-INF/src:
> java
>
> target/struts2-blank/WEB-INF/src/java:
> example
>
> target/struts2-blank/WEB-INF/src/java/example:
> ExampleSupport.java  HelloWorld.java  Login.java
>
> This will wrap, but just so we're sure we're both using the same config:
>
> $ svn diff
> Index: pom.xml
> ===================================================================
> --- pom.xml     (revision 440812)
> +++ pom.xml     (working copy)
> @@ -142,6 +142,26 @@
>                      </configuration>
>                  </configuration>
>              </plugin>
> +                     <plugin>
> +            <artifactId>maven-antrun-plugin</artifactId>
> +            <executions>
> +               <execution>
> +                  <id>copy-sources</id>
> +                  <phase>process-sources</phase>
> +                  <configuration>
> +                     <tasks>
> +                        <copy
> todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
> +                              failonerror="false">
> +                           <fileset dir="${basedir}/src/main/java"/>
> +                        </copy>
> +                     </tasks>
> +                  </configuration>
> +                  <goals>
> +                     <goal>run</goal>
> +                  </goals>
> +               </execution>
> +            </executions>
> +         </plugin>
>          </plugins>
>
>          <finalName>${pom.artifactId}</finalName>
>
> Then I tried building all the apps from struts2/apps:
>
> $ pwd
> /cygdrive/c/svn/struts/current/struts2/apps
>
> $ mvn clean; mvn install
> ...
>
> $ ls -R blank/target/struts2-blank/WEB-INF/src
> blank/target/struts2-blank/WEB-INF/src:
> java
>
> blank/target/struts2-blank/WEB-INF/src/java:
> example
>
> blank/target/struts2-blank/WEB-INF/src/java/example:
> ExampleSupport.java  HelloWorld.java  Login.java
>
> I don't know why it isn't working for you from 'apps', but if you can
> get it to work by duplicating the config in each of the example apps'
> poms, I'd just do that, with a comment so we can fix it later.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>


-- 
HTH, Ted.
* http://www.husted.com/struts/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by Wendy Smoak <ws...@gmail.com>.
On 9/6/06, Ted Husted <hu...@apache.org> wrote:

> It didn't show my changes. I'm not sure if it's showing anything from
> the POM under apps.
>
> If I move the changes down to the blank POM, it works just fine.

I pasted the copy-sources config into struts-apps-parent, and then
from struts2/apps/blank, ran 'mvn install'.

I specifically did not install the struts-apps-parent pom, just to see
whether Maven would pick up the changes from the filesystem w/o
installing it.

It's working fine here, both from 'apps/blank' and from 'apps'.

$ pwd
/cygdrive/c/svn/struts/current/struts2/apps/blank

$ mvn install
...
$ ls -R target/struts2-blank/WEB-INF/src
target/struts2-blank/WEB-INF/src:
java

target/struts2-blank/WEB-INF/src/java:
example

target/struts2-blank/WEB-INF/src/java/example:
ExampleSupport.java  HelloWorld.java  Login.java

This will wrap, but just so we're sure we're both using the same config:

$ svn diff
Index: pom.xml
===================================================================
--- pom.xml     (revision 440812)
+++ pom.xml     (working copy)
@@ -142,6 +142,26 @@
                     </configuration>
                 </configuration>
             </plugin>
+                     <plugin>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+               <execution>
+                  <id>copy-sources</id>
+                  <phase>process-sources</phase>
+                  <configuration>
+                     <tasks>
+                        <copy
todir="${project.build.directory}/${pom.artifactId}/WEB-INF/src/java"
+                              failonerror="false">
+                           <fileset dir="${basedir}/src/main/java"/>
+                        </copy>
+                     </tasks>
+                  </configuration>
+                  <goals>
+                     <goal>run</goal>
+                  </goals>
+               </execution>
+            </executions>
+         </plugin>
         </plugins>

         <finalName>${pom.artifactId}</finalName>

Then I tried building all the apps from struts2/apps:

$ pwd
/cygdrive/c/svn/struts/current/struts2/apps

$ mvn clean; mvn install
...

$ ls -R blank/target/struts2-blank/WEB-INF/src
blank/target/struts2-blank/WEB-INF/src:
java

blank/target/struts2-blank/WEB-INF/src/java:
example

blank/target/struts2-blank/WEB-INF/src/java/example:
ExampleSupport.java  HelloWorld.java  Login.java

I don't know why it isn't working for you from 'apps', but if you can
get it to work by duplicating the config in each of the example apps'
poms, I'd just do that, with a comment so we can fix it later.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by Ted Husted <hu...@apache.org>.
On 9/6/06, Wendy Smoak <ws...@gmail.com> wrote:
> Try this from the webapp that is not including the source code:  mvn
> help:effective-pom
>
> Does that show your changes?
>
> Right now I'm not sure if the config you added is present and not
> working, or if it's not even getting picked up.

It didn't show my changes. I'm not sure if it's showing anything from
the POM under apps.

If I move the changes down to the blank POM, it works just fine.

-Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by Wendy Smoak <ws...@gmail.com>.
On 9/6/06, Ted Husted <hu...@apache.org> wrote:
> On 9/6/06, Wendy Smoak <ws...@gmail.com> wrote:
> > On 9/6/06, Ted Husted <hu...@apache.org> wrote:
> >
> > > I tried to update the S2 apps POM to bundle the source, as we do with
> > > the S1 apps, but it didn't seem to work.
> > ...
> > > Is there something else we need to do?
> >
> > After you made the change to struts2-apps-parent, did you 'mvn
> > install' it so the updated version is in your local repository?
>
> No. I'm still "banging the rocks together" when it comes to Maven,
> and, offhand, I don't even know how to 'mvn install' it, if you are
> talking about a special step outside an ordinary mvn install.

No... the usual.  Just do 'mvn install' from the directory where you
made the change to the pom, so it will get installed in your local
repository.

> I do know it chokes on XML errors, and an ordinary mvn install causes
> the POM to be read and rewritten. So something is reading for some
> reason.

Try this from the webapp that is not including the source code:  mvn
help:effective-pom

Does that show your changes?

Right now I'm not sure if the config you added is present and not
working, or if it's not even getting picked up.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by Ted Husted <hu...@apache.org>.
On 9/6/06, Wendy Smoak <ws...@gmail.com> wrote:
> On 9/6/06, Ted Husted <hu...@apache.org> wrote:
>
> > I tried to update the S2 apps POM to bundle the source, as we do with
> > the S1 apps, but it didn't seem to work.
> ...
> > Is there something else we need to do?
>
> After you made the change to struts2-apps-parent, did you 'mvn
> install' it so the updated version is in your local repository?

No. I'm still "banging the rocks together" when it comes to Maven,
and, offhand, I don't even know how to 'mvn install' it, if you are
talking about a special step outside an ordinary mvn install.

I do know it chokes on XML errors, and an ordinary mvn install causes
the POM to be read and rewritten. So something is reading for some
reason.

-Ted.


>
> (If you want to install just that pom without rebuilding all of the
> apps: mvn install -N .)
>
> Maven is supposed to look for ../pom.xml (and pay attention to
> <parent>/<relativePath>) before looking in the local repository, but I
> don't think it does.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>


-- 
HTH, Ted.
* http://www.husted.com/struts/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [s2] Source with examples

Posted by Wendy Smoak <ws...@gmail.com>.
On 9/6/06, Ted Husted <hu...@apache.org> wrote:

> I tried to update the S2 apps POM to bundle the source, as we do with
> the S1 apps, but it didn't seem to work.
...
> Is there something else we need to do?

After you made the change to struts2-apps-parent, did you 'mvn
install' it so the updated version is in your local repository?

(If you want to install just that pom without rebuilding all of the
apps: mvn install -N .)

Maven is supposed to look for ../pom.xml (and pay attention to
<parent>/<relativePath>) before looking in the local repository, but I
don't think it does.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org