Return-Path: Delivered-To: apmail-maven-users-archive@www.apache.org Received: (qmail 92241 invoked from network); 11 Feb 2010 17:35:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Feb 2010 17:35:20 -0000 Received: (qmail 79327 invoked by uid 500); 11 Feb 2010 17:35:17 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 79228 invoked by uid 500); 11 Feb 2010 17:35:17 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 79218 invoked by uid 99); 11 Feb 2010 17:35:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 17:35:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kalle.o.korhonen@gmail.com designates 209.85.223.194 as permitted sender) Received: from [209.85.223.194] (HELO mail-iw0-f194.google.com) (209.85.223.194) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Feb 2010 17:35:09 +0000 Received: by iwn32 with SMTP id 32so2494588iwn.14 for ; Thu, 11 Feb 2010 09:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=qS8tLm7wUvQ+jXH3PHLnt/eVoJkWpZeCSvpaB1AcBF8=; b=QHgqViQtlrtIxJAegSmNkOd5xJmBSccRgDJlfSnxH9GBtPvOENFFvpIebHjFx3xPPo A8fOTx38KfeX//mVVUEulT4Yjg9x6DaZZ6qdNbaO/O3hoO4zJRCblotPoMAxwXirqmZi xxnw5RTH9JQ2939XAnIshHN/GTKUMIjicMG50= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=xJwi9DzIZYgSGWgArRXihBdaD+vXKkUEj6gG/mTtFxiIYbbG1NV/v53i304W7c3kGZ j8GtJoPbl5DLfLejbCO43hj2vf7JTMGqxdi/v/5RIxZfEuEgTBE4jHT8EaenKubVRwM0 udF0tLK/0QFtPQLaDOVgwwT1+HzjeO9cVySuA= MIME-Version: 1.0 Received: by 10.231.149.9 with SMTP id r9mr199071ibv.82.1265909687103; Thu, 11 Feb 2010 09:34:47 -0800 (PST) In-Reply-To: <876138711002110613j16aab744uae90c28c3b9583b6@mail.gmail.com> References: <4B73434F.8090907@cisco.com> <876138711002110613j16aab744uae90c28c3b9583b6@mail.gmail.com> Date: Thu, 11 Feb 2010 09:34:47 -0800 Message-ID: <7281ca711002110934x1b983f0fxd1f79cf41fe25bc@mail.gmail.com> Subject: Re: unit testing archetypes From: Kalle Korhonen To: Maven Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Good stuff Luke, thanks, I've been pondering what the best approach is for this myself. Kalle On Thu, Feb 11, 2010 at 6:13 AM, Luke Patterson wrote: > On Wed, Feb 10, 2010 at 5:37 PM, Max Spring wrote: >> What would be a good approach to test an archetype project? >> ... >> A minimal test would be to "instantiate" the archetype and to build the = resulting project. > > Here's some cut-and-paste that I'm using: > > > org.apache.maven.plugins > maven-invoker-plugin > > =A0 > =A0 =A0integration-test > =A0 =A0 > =A0 =A0 =A0install > =A0 =A0 =A0run > =A0 =A0 > =A0 > > > =A0${project.build.directory}/it/projects > =A0 > =A0 =A0org.apache.maven.plugins:maven-archetype-plugin:generate > =A0 > =A0${project.build.directory}/it/repo > =A0 > =A0 =A0* > =A0 > =A0${basedir}/src/it/projects > =A0 > =A0 =A0${project.artifactId} > =A0 =A0${project.groupId} > =A0 =A0local > =A0 =A0${project.version} > =A0 =A0verify > =A0 =A0false > =A0 > =A0true > > > > > then, your archetype will be run during integration-test phase for all > subdirectories of , a test.properties file will > contain the inputs to the archetype:generate goal, and the verify > phase will be run on each newly generated project > > to add a new test, add another directory under > with a test.properties file > > ------------------------------------------ > e.g. > > src/it/projects/firsttest/test.properties with contents: > > groupId=3Dcom.foo > artifactId=3Dfirsttest > version=3D1.0.0 > package=3Dcom.foo.firsttest > > that will create a "firsttest" directory under > ${project.build.directory}/it/projects/firsttest with the stuff > generated by your archetype, and then run the verify phase on the > newly generated "com.foo.firsttest" project > ------------------------------------------ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > For additional commands, e-mail: users-help@maven.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org