You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by Christian Hammers <ch...@lathspell.de> on 2009/10/24 22:44:10 UTC

assemblies

Hi

Now "mvn clean && mvn package" fails:
	[INFO] [assembly:assembly {execution: make-assembly}]
	[INFO] Reading assembly descriptor: src/assembly/bin.xml
	[INFO]
	------------------------------------------------------------------------
	[ERROR] BUILD FAILURE [INFO]
	------------------------------------------------------------------------
	[INFO] :
	org.apache.maven.plugin.assembly.io.DefaultAssemblyReader@7051630a
		site did not exist in the target directory - please run
		site:site before creating the assembly

		Mojo configuration is invalid: site did not exist in
		the target directory - please run site:site before
		creating the assembly

If I understood Maven life cycles correctly, the default lifecycle
with compile and package is supposed to run without having to run the
site lifecycle in between.... 
The problematic line is:
          <includeSiteDirectory>true</includeSiteDirectory>


But somehow that doesn't work out anyway:
You created a bin.xml that produces not a "bin" but the
	apache-log4php-2.0.0-incubating-src.tar.gz 
with all source files (except the package* and legacy CHANGELOG).

Then there is the pear-assembly.xml which does also packages the sources
but is no PEAR package because the package.xml is not generated anymore.


I would propose to have the following:

* src/assembly/src.xml 
	Creates log4php-2.0.0-incubating-src.zip/tgz with everything
	that survives "mvn clean".

* src/assembly/bin.xml
	Creates log4php-2.0.0-incubating.zip/tgz with just the
	src/main/php/ directory, renamed to log4php/ together
	with the CHANGELOGs + READMEs. It's for users who just want to
	copy one directoy to their /usr/local/share/php/

* src/assembly/pear-package.xml
	Creates log4php-2.0.0incubating.tgz (no zip necessary) that
  	contains src/main/php/, src/main/examples/, the toplevel
  	READMEs and a valid package.xml which has to be produced using
 	the pacakge-* scripts as ant task. The latter should be bound
  	to the maven "prepare-package" phase and stay in pom.xml.

What do you think?

bye,

-christian-



Am Fri, 23 Oct 2009 08:56:55 +0200
schrieb Christian Grobmeier <gr...@gmail.com>:

> Hi Christian
> 
> its not necessary to add this one here. The file in question is
> src/assembly/bin.xml were it's already included.
> I have added the pear-assembly file, but can you help going through
> it? There is some execution missing, which we need to create in the
> pom :-)
> 
> Cheers
> 
> On Fri, Oct 23, 2009 at 12:28 AM,  <ch...@apache.org> wrote:
> > Author: chammers
> > Date: Thu Oct 22 22:28:53 2009
> > New Revision: 828879
> >
> > URL: http://svn.apache.org/viewvc?rev=828879&view=rev
> > Log:
> > Create .zip file with identical content as the PEAR .tgz.
> > Too bad that the PEAR version number may not (it's validated)
> > contain the -SNAPSHOT so the it has to be specified separately. I
> > could not find out how to elegantly use sed or a regex in the
> > pom.xml.
> >
> > Modified:
> >    incubator/log4php/trunk/pom.xml
> >
> > Modified: incubator/log4php/trunk/pom.xml
> > URL:
> > http://svn.apache.org/viewvc/incubator/log4php/trunk/pom.xml?rev=828879&r1=828878&r2=828879&view=diff
> > ==============================================================================
> > --- incubator/log4php/trunk/pom.xml (original) +++
> > incubator/log4php/trunk/pom.xml Thu Oct 22 22:28:53 2009 @@ -117,6
> > +117,7 @@ <properties>
> >                <surefire.reports>target/surefire-reports</surefire.reports>
> >                <coverage.report>target/site/coverage-report</coverage.report>
> > +               <pear.version>2.0</pear.version>
> >        </properties>
> >
> >        <build>
> > @@ -190,6 +191,14 @@
> >                                 <exec executable="pear"
> > dir="target/pear"> <arg line="package"/>
> >                                 </exec>
> > +                                <!-- Create zip archive with
> > identical contents as the .tgz -->
> > +                                <!-- The version number of the
> > pear package does never contain -SNAPSHOT. -->
> > +                                <untar dest="target/zip">
> > +                                    <gzipresource>
> > +                                        <file
> > file="target/pear/log4php-${pear.version}.tgz"/>
> > +                                    </gzipresource>
> > +                                </untar>
> > +                                <zip
> > destfile="target/pear/log4php-${pear.version}.zip"
> > basedir="target/zip/" /> </tasks> </configuration>
> >                     </execution>
> >
> >
> >

Re: assemblies

Posted by Christian Grobmeier <gr...@gmail.com>.
Hi Christian,

> I'd rather like to have the creation of the zip files back in the
> package phase. After all that's what "package" is intended for.

I don't think that the package phase is intended for the creation of
several zip/gz whatever. From the mvn docs, it's just here to: "take
the compiled code and package it in its distributable format, such as
a JAR.". In my understanding it doesn't mean to create several
packages with package.xml without etc, it just would take the
src/main/php code.

On the other hand the assembly plugin is creating a real assembly: "An
"assembly" is a group of files, directories, and dependencies that are
assembled into an archive format and distributed".

Since I distinguish between package and assembly, i think its much
more cleaner to make this work with assembly plugin. Finally I find it
much easier to create new assemblies with the assembly plugin than
with the package plugin.


> If you want the phpdoc be contained in the zip, it should be
> run in the package phase as well. The maven-javadoc-plugin suggests
> this as well if one wants to distribute javadoc as downloadable package.

Yes, if you distribute it as a jar this makes sense.

> Building it this way would have the advantage that we could later
> start doing fancy stuff in the "validate" and "deploy" phases as well.

Thats true, but I am not sure if I want such fancy stuff :-)

Cheers
Christian


> Attached is a patch that does exactly this. If it's ok for you, I
> commit.
>
> BTW, phpunit was started twice, once for code coverage and once for
> surefire, I merged those two runs into one.
>
> bye,
>
> -christian-
>
>
>
>
> Am Sun, 25 Oct 2009 12:56:45 +0100
> schrieb Christian Grobmeier <gr...@gmail.com>:
>
>> Hi,
>>
>> > If I understood Maven life cycles correctly, the default lifecycle
>> > with compile and package is supposed to run without having to run
>> > the site lifecycle in between....
>> > The problematic line is:
>> >          <includeSiteDirectory>true</includeSiteDirectory>
>>
>> No, its because I appended the assembly to the package phase. We
>> should delete this line:
>>
>> <phase>package</phase>
>>
>> I will do that later
>> That way assembly and package is independent again
>>
>>
>> > Then there is the pear-assembly.xml which does also packages the
>> > sources but is no PEAR package because the package.xml is not
>> > generated anymore.
>>
>> Yes thats why I asked for your help - i have the lines in the
>> execution  block in the pom, but commented out. We would need to
>> generate this while building. But now I can do this myself :-)
>>
>> > I would propose to have the following:
>> >
>> > * src/assembly/src.xml
>> >        Creates log4php-2.0.0-incubating-src.zip/tgz with everything
>> >        that survives "mvn clean".
>> >
>> > * src/assembly/bin.xml
>> >        Creates log4php-2.0.0-incubating.zip/tgz with just the
>> >        src/main/php/ directory, renamed to log4php/ together
>> >        with the CHANGELOGs + READMEs. It's for users who just want
>> > to copy one directoy to their /usr/local/share/php/
>> >
>> > * src/assembly/pear-package.xml
>> >        Creates log4php-2.0.0incubating.tgz (no zip necessary) that
>> >        contains src/main/php/, src/main/examples/, the toplevel
>> >        READMEs and a valid package.xml which has to be produced
>> > using the pacakge-* scripts as ant task. The latter should be bound
>> >        to the maven "prepare-package" phase and stay in pom.xml.
>> >
>> > What do you think?
>>
>>
>> I agree to the pear-package with having package.xml of course and
>> everything which is needed by pear (means: no test-php).
>>
>> But for the other, I think we need a simple package with everything
>> included, tests and code, license and stuff. I don't see to separate
>> between bin and src, since php doesn't have binaries. I also don't
>> like to touch the directory structure - one can easily copy from
>> src/main/php what he needs. Everything else could lead to confusion
>> with bugreporting.
>>
>> With the fix above goals should work again.
>>
>> Cheers,
>> Christian
>>
>>
>> >
>> > bye,
>> >
>> > -christian-
>> >
>> >
>> >
>> > Am Fri, 23 Oct 2009 08:56:55 +0200
>> > schrieb Christian Grobmeier <gr...@gmail.com>:
>> >
>> >> Hi Christian
>> >>
>> >> its not necessary to add this one here. The file in question is
>> >> src/assembly/bin.xml were it's already included.
>> >> I have added the pear-assembly file, but can you help going through
>> >> it? There is some execution missing, which we need to create in the
>> >> pom :-)
>> >>
>> >> Cheers
>> >>
>> >> On Fri, Oct 23, 2009 at 12:28 AM,  <ch...@apache.org> wrote:
>> >> > Author: chammers
>> >> > Date: Thu Oct 22 22:28:53 2009
>> >> > New Revision: 828879
>> >> >
>> >> > URL: http://svn.apache.org/viewvc?rev=828879&view=rev
>> >> > Log:
>> >> > Create .zip file with identical content as the PEAR .tgz.
>> >> > Too bad that the PEAR version number may not (it's validated)
>> >> > contain the -SNAPSHOT so the it has to be specified separately. I
>> >> > could not find out how to elegantly use sed or a regex in the
>> >> > pom.xml.
>> >> >
>> >> > Modified:
>> >> >    incubator/log4php/trunk/pom.xml
>> >> >
>> >> > Modified: incubator/log4php/trunk/pom.xml
>> >> > URL:
>> >> > http://svn.apache.org/viewvc/incubator/log4php/trunk/pom.xml?rev=828879&r1=828878&r2=828879&view=diff
>> >> > ==============================================================================
>> >> > --- incubator/log4php/trunk/pom.xml (original) +++
>> >> > incubator/log4php/trunk/pom.xml Thu Oct 22 22:28:53 2009 @@
>> >> > -117,6 +117,7 @@ <properties>
>> >> >                <surefire.reports>target/surefire-reports</surefire.reports>
>> >> >                <coverage.report>target/site/coverage-report</coverage.report>
>> >> > +               <pear.version>2.0</pear.version>
>> >> >        </properties>
>> >> >
>> >> >        <build>
>> >> > @@ -190,6 +191,14 @@
>> >> >                                 <exec executable="pear"
>> >> > dir="target/pear"> <arg line="package"/>
>> >> >                                 </exec>
>> >> > +                                <!-- Create zip archive with
>> >> > identical contents as the .tgz -->
>> >> > +                                <!-- The version number of the
>> >> > pear package does never contain -SNAPSHOT. -->
>> >> > +                                <untar dest="target/zip">
>> >> > +                                    <gzipresource>
>> >> > +                                        <file
>> >> > file="target/pear/log4php-${pear.version}.tgz"/>
>> >> > +                                    </gzipresource>
>> >> > +                                </untar>
>> >> > +                                <zip
>> >> > destfile="target/pear/log4php-${pear.version}.zip"
>> >> > basedir="target/zip/" /> </tasks> </configuration>
>> >> >                     </execution>
>> >> >
>> >> >
>> >> >
>> >
>

Re: assemblies

Posted by Christian Hammers <ch...@lathspell.de>.
Hello

I'd rather like to have the creation of the zip files back in the
package phase. After all that's what "package" is intended for.

If you want the phpdoc be contained in the zip, it should be
run in the package phase as well. The maven-javadoc-plugin suggests
this as well if one wants to distribute javadoc as downloadable package.

Building it this way would have the advantage that we could later
start doing fancy stuff in the "validate" and "deploy" phases as well.

Attached is a patch that does exactly this. If it's ok for you, I
commit.

BTW, phpunit was started twice, once for code coverage and once for
surefire, I merged those two runs into one. 

bye,

-christian-




Am Sun, 25 Oct 2009 12:56:45 +0100
schrieb Christian Grobmeier <gr...@gmail.com>:

> Hi,
> 
> > If I understood Maven life cycles correctly, the default lifecycle
> > with compile and package is supposed to run without having to run
> > the site lifecycle in between....
> > The problematic line is:
> >          <includeSiteDirectory>true</includeSiteDirectory>
> 
> No, its because I appended the assembly to the package phase. We
> should delete this line:
> 
> <phase>package</phase>
> 
> I will do that later
> That way assembly and package is independent again
> 
> 
> > Then there is the pear-assembly.xml which does also packages the
> > sources but is no PEAR package because the package.xml is not
> > generated anymore.
> 
> Yes thats why I asked for your help - i have the lines in the
> execution  block in the pom, but commented out. We would need to
> generate this while building. But now I can do this myself :-)
> 
> > I would propose to have the following:
> >
> > * src/assembly/src.xml
> >        Creates log4php-2.0.0-incubating-src.zip/tgz with everything
> >        that survives "mvn clean".
> >
> > * src/assembly/bin.xml
> >        Creates log4php-2.0.0-incubating.zip/tgz with just the
> >        src/main/php/ directory, renamed to log4php/ together
> >        with the CHANGELOGs + READMEs. It's for users who just want
> > to copy one directoy to their /usr/local/share/php/
> >
> > * src/assembly/pear-package.xml
> >        Creates log4php-2.0.0incubating.tgz (no zip necessary) that
> >        contains src/main/php/, src/main/examples/, the toplevel
> >        READMEs and a valid package.xml which has to be produced
> > using the pacakge-* scripts as ant task. The latter should be bound
> >        to the maven "prepare-package" phase and stay in pom.xml.
> >
> > What do you think?
> 
> 
> I agree to the pear-package with having package.xml of course and
> everything which is needed by pear (means: no test-php).
> 
> But for the other, I think we need a simple package with everything
> included, tests and code, license and stuff. I don't see to separate
> between bin and src, since php doesn't have binaries. I also don't
> like to touch the directory structure - one can easily copy from
> src/main/php what he needs. Everything else could lead to confusion
> with bugreporting.
> 
> With the fix above goals should work again.
> 
> Cheers,
> Christian
> 
> 
> >
> > bye,
> >
> > -christian-
> >
> >
> >
> > Am Fri, 23 Oct 2009 08:56:55 +0200
> > schrieb Christian Grobmeier <gr...@gmail.com>:
> >
> >> Hi Christian
> >>
> >> its not necessary to add this one here. The file in question is
> >> src/assembly/bin.xml were it's already included.
> >> I have added the pear-assembly file, but can you help going through
> >> it? There is some execution missing, which we need to create in the
> >> pom :-)
> >>
> >> Cheers
> >>
> >> On Fri, Oct 23, 2009 at 12:28 AM,  <ch...@apache.org> wrote:
> >> > Author: chammers
> >> > Date: Thu Oct 22 22:28:53 2009
> >> > New Revision: 828879
> >> >
> >> > URL: http://svn.apache.org/viewvc?rev=828879&view=rev
> >> > Log:
> >> > Create .zip file with identical content as the PEAR .tgz.
> >> > Too bad that the PEAR version number may not (it's validated)
> >> > contain the -SNAPSHOT so the it has to be specified separately. I
> >> > could not find out how to elegantly use sed or a regex in the
> >> > pom.xml.
> >> >
> >> > Modified:
> >> >    incubator/log4php/trunk/pom.xml
> >> >
> >> > Modified: incubator/log4php/trunk/pom.xml
> >> > URL:
> >> > http://svn.apache.org/viewvc/incubator/log4php/trunk/pom.xml?rev=828879&r1=828878&r2=828879&view=diff
> >> > ==============================================================================
> >> > --- incubator/log4php/trunk/pom.xml (original) +++
> >> > incubator/log4php/trunk/pom.xml Thu Oct 22 22:28:53 2009 @@
> >> > -117,6 +117,7 @@ <properties>
> >> >                <surefire.reports>target/surefire-reports</surefire.reports>
> >> >                <coverage.report>target/site/coverage-report</coverage.report>
> >> > +               <pear.version>2.0</pear.version>
> >> >        </properties>
> >> >
> >> >        <build>
> >> > @@ -190,6 +191,14 @@
> >> >                                 <exec executable="pear"
> >> > dir="target/pear"> <arg line="package"/>
> >> >                                 </exec>
> >> > +                                <!-- Create zip archive with
> >> > identical contents as the .tgz -->
> >> > +                                <!-- The version number of the
> >> > pear package does never contain -SNAPSHOT. -->
> >> > +                                <untar dest="target/zip">
> >> > +                                    <gzipresource>
> >> > +                                        <file
> >> > file="target/pear/log4php-${pear.version}.tgz"/>
> >> > +                                    </gzipresource>
> >> > +                                </untar>
> >> > +                                <zip
> >> > destfile="target/pear/log4php-${pear.version}.zip"
> >> > basedir="target/zip/" /> </tasks> </configuration>
> >> >                     </execution>
> >> >
> >> >
> >> >
> >

Re: assemblies

Posted by Christian Grobmeier <gr...@gmail.com>.
Hi,

> If I understood Maven life cycles correctly, the default lifecycle
> with compile and package is supposed to run without having to run the
> site lifecycle in between....
> The problematic line is:
>          <includeSiteDirectory>true</includeSiteDirectory>

No, its because I appended the assembly to the package phase. We
should delete this line:

<phase>package</phase>

I will do that later
That way assembly and package is independent again


> Then there is the pear-assembly.xml which does also packages the sources
> but is no PEAR package because the package.xml is not generated anymore.

Yes thats why I asked for your help - i have the lines in the
execution  block in the pom, but commented out. We would need to
generate this while building. But now I can do this myself :-)

> I would propose to have the following:
>
> * src/assembly/src.xml
>        Creates log4php-2.0.0-incubating-src.zip/tgz with everything
>        that survives "mvn clean".
>
> * src/assembly/bin.xml
>        Creates log4php-2.0.0-incubating.zip/tgz with just the
>        src/main/php/ directory, renamed to log4php/ together
>        with the CHANGELOGs + READMEs. It's for users who just want to
>        copy one directoy to their /usr/local/share/php/
>
> * src/assembly/pear-package.xml
>        Creates log4php-2.0.0incubating.tgz (no zip necessary) that
>        contains src/main/php/, src/main/examples/, the toplevel
>        READMEs and a valid package.xml which has to be produced using
>        the pacakge-* scripts as ant task. The latter should be bound
>        to the maven "prepare-package" phase and stay in pom.xml.
>
> What do you think?


I agree to the pear-package with having package.xml of course and
everything which is needed by pear (means: no test-php).

But for the other, I think we need a simple package with everything
included, tests and code, license and stuff. I don't see to separate
between bin and src, since php doesn't have binaries. I also don't
like to touch the directory structure - one can easily copy from
src/main/php what he needs. Everything else could lead to confusion
with bugreporting.

With the fix above goals should work again.

Cheers,
Christian


>
> bye,
>
> -christian-
>
>
>
> Am Fri, 23 Oct 2009 08:56:55 +0200
> schrieb Christian Grobmeier <gr...@gmail.com>:
>
>> Hi Christian
>>
>> its not necessary to add this one here. The file in question is
>> src/assembly/bin.xml were it's already included.
>> I have added the pear-assembly file, but can you help going through
>> it? There is some execution missing, which we need to create in the
>> pom :-)
>>
>> Cheers
>>
>> On Fri, Oct 23, 2009 at 12:28 AM,  <ch...@apache.org> wrote:
>> > Author: chammers
>> > Date: Thu Oct 22 22:28:53 2009
>> > New Revision: 828879
>> >
>> > URL: http://svn.apache.org/viewvc?rev=828879&view=rev
>> > Log:
>> > Create .zip file with identical content as the PEAR .tgz.
>> > Too bad that the PEAR version number may not (it's validated)
>> > contain the -SNAPSHOT so the it has to be specified separately. I
>> > could not find out how to elegantly use sed or a regex in the
>> > pom.xml.
>> >
>> > Modified:
>> >    incubator/log4php/trunk/pom.xml
>> >
>> > Modified: incubator/log4php/trunk/pom.xml
>> > URL:
>> > http://svn.apache.org/viewvc/incubator/log4php/trunk/pom.xml?rev=828879&r1=828878&r2=828879&view=diff
>> > ==============================================================================
>> > --- incubator/log4php/trunk/pom.xml (original) +++
>> > incubator/log4php/trunk/pom.xml Thu Oct 22 22:28:53 2009 @@ -117,6
>> > +117,7 @@ <properties>
>> >                <surefire.reports>target/surefire-reports</surefire.reports>
>> >                <coverage.report>target/site/coverage-report</coverage.report>
>> > +               <pear.version>2.0</pear.version>
>> >        </properties>
>> >
>> >        <build>
>> > @@ -190,6 +191,14 @@
>> >                                 <exec executable="pear"
>> > dir="target/pear"> <arg line="package"/>
>> >                                 </exec>
>> > +                                <!-- Create zip archive with
>> > identical contents as the .tgz -->
>> > +                                <!-- The version number of the
>> > pear package does never contain -SNAPSHOT. -->
>> > +                                <untar dest="target/zip">
>> > +                                    <gzipresource>
>> > +                                        <file
>> > file="target/pear/log4php-${pear.version}.tgz"/>
>> > +                                    </gzipresource>
>> > +                                </untar>
>> > +                                <zip
>> > destfile="target/pear/log4php-${pear.version}.zip"
>> > basedir="target/zip/" /> </tasks> </configuration>
>> >                     </execution>
>> >
>> >
>> >
>