Return-Path: Delivered-To: apmail-maven-users-archive@www.apache.org Received: (qmail 87137 invoked from network); 30 Mar 2006 21:55:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Mar 2006 21:55:12 -0000 Received: (qmail 32925 invoked by uid 500); 30 Mar 2006 21:55:07 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 32506 invoked by uid 500); 30 Mar 2006 21:55:06 -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 32487 invoked by uid 99); 30 Mar 2006 21:55:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2006 13:55:05 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [144.81.97.25] (HELO mg2.ets.org) (144.81.97.25) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2006 13:55:04 -0800 Received: from lan.ets.org (HELO rosnt106.etslan.org) ([144.81.127.23]) by mg2.ets.org with ESMTP; 30 Mar 2006 16:54:42 -0500 X-IronPort-AV: i="4.03,147,1141621200"; d="scan'208"; a="373200871:sNHT114658348" Received: from rosnt108.etslan.org ([144.81.127.27]) by rosnt106.etslan.org with Microsoft SMTPSVC(6.0.3790.211); Thu, 30 Mar 2006 16:54:41 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: [m2.0.3] Embedder - setAlignWithUser ignored Date: Thu, 30 Mar 2006 16:54:41 -0500 Message-ID: <67ACE95E454E424E9F838894125D5177FFB6AE@rosnt108.etslan.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [m2.0.3] Embedder - setAlignWithUser ignored Thread-Index: AcZURIwWh2Kuf3hFRJOJkUr6WDaruw== From: "Rollo, Dan" To: "Jason van Zyl" , "Maven Users List" X-OriginalArrivalTime: 30 Mar 2006 21:54:41.0890 (UTC) FILETIME=[8C887420:01C65444] Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Cool. Just to verify if I'm thinking correctly: Would the "correct" usage be: 1=2E setLocalRepositoryDirectory(); 2=2E alignWithUserInstallation(false); 3=2E mavenEmbedder.start(); Thanks, Dan PS: Any chance this fix could make it into 2.0.4?=20 -----Original Message----- From: Jason van Zyl [mailto:jason@maven.org]=20 Sent: Thursday, March 30, 2006 4:29 PM To: Maven Users List Subject: Re: [m2.0.3] Embedder - setAlignWithUser ignored Rollo, Dan wrote: > It appears there is no way to override the "localRepository" used by=20 > MavenEmbedder. There is on a branch I'm working on which will most likely be merged into the trunk after the 2.0.4 release. >=20 > Some code from MavenEmbedder.java: >=20 > public void setLocalRepositoryDirectory( File=20 > localRepositoryDirectory ) > { > this.localRepositoryDirectory =3D localRepositoryDirectory; > } > ... > public void start() > throws MavenEmbedderException > { > detectUserInstallation(); > ... >=20 > private void detectUserInstallation() > { > if ( new File( userHome, ".m2" ).exists() ) > { > alignWithUserInstallation =3D true; > } > } >=20 > /** > * Create the Settings that will be used with the embedder. If we=20 > are aligning with the user > * installation then we lookup the standard settings builder and=20 > use that to create our > * settings. Otherwise we constructs a settings object and=20 > populate the information > * ourselves. > * > * @throws MavenEmbedderException > * @throws ComponentLookupException > */ > private void createMavenSettings() > throws MavenEmbedderException, ComponentLookupException > { > if ( alignWithUserInstallation ) > { > // > ---------------------------------------------------------------------- > // We will use the standard method for creating the=20 > settings. This > // method reproduces the method of building the settings=20 > from the CLI > // mode of operation. > // > ---------------------------------------------------------------------- >=20 > settingsBuilder =3D (MavenSettingsBuilder) embedder.lookup(=20 > MavenSettingsBuilder.ROLE ); ... > } > else > { > if ( localRepository =3D=3D null ) > { > throw new IllegalArgumentException( "When not aligning > with a user install you must specify a local repository location using > the setLocalRepositoryDirectory( File ) method." ); > } >=20 > settings =3D new Settings(); >=20 > settings.setLocalRepository( > localRepositoryDirectory.getAbsolutePath() ); ... >=20 >=20 >>>From the behavior and code, the detectUserInstallation() method will > never allow me to override the localRepository if an ".m2" user=20 > directory exists (even if I call setAlignWithUserInstallation(false) > before calling start() ). This don't seem right.=20 >=20 > I believe the purpose of the setLocalRepositoryDirectory() is to allow > overriding the default local repo location, but the current logic in=20 > the > start() method always sets the field "alignWithUserInstallation" to=20 > true if ".m2" exists. >=20 > Is the local repo dir supposed to be overridable, and if so, is there=20 > some other way to do it? >=20 > Thanks, > Dan >=20 > -------------------------------------------------- > This e-mail and any files transmitted with it may contain privileged or confidential information. > It is solely for use by the individual for whom it is intended, even if addressed incorrectly. > If you received this e-mail in error, please notify the sender; do not > disclose, copy, distribute, or take any action in reliance on the=20 > contents of this information; and delete it from your system. Any other use of this e-mail is prohibited. >=20 > Thank you for your compliance. > -------------------------------------------------- >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > For additional commands, e-mail: users-help@maven.apache.org >=20 >=20 >=20 -- jvz. Jason van Zyl jason at maven.org http://maven.apache.org Simplex sigillum veri. (Simplicity is the seal of truth.) -------------------------------------------------- This e-mail and any files transmitted with it may contain privileged or con= fidential information. It is solely for use by the individual for whom it is intended, even if add= ressed incorrectly. If you received this e-mail in error, please notify the sender; do not disc= lose, copy, distribute, or take any action in reliance on the contents of this information; and del= ete it from your system. Any other use of this e-mail is prohibited. Thank you for your compliance. -------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org