r588 - in trunk: . src/main/java/org/nuiton src/main/java/org/nuiton/components src/main/java/org/nuiton/components/cipher src/main/java/org/nuiton/components/sec src/main/java/org/nuiton/components/sec/dispatcher src/main/java/org/nuiton/mail/plugin src/main/resources/META-INF/plexus
Author: tchemit Date: 2009-09-25 23:59:57 +0200 (Fri, 25 Sep 2009) New Revision: 588 Added: trunk/src/main/java/org/nuiton/components/ trunk/src/main/java/org/nuiton/components/cipher/ trunk/src/main/java/org/nuiton/components/cipher/DefaultPlexusCipher.java trunk/src/main/java/org/nuiton/components/sec/ trunk/src/main/java/org/nuiton/components/sec/dispatcher/ trunk/src/main/java/org/nuiton/components/sec/dispatcher/DefaultSecDispatcher.java Modified: trunk/pom.xml trunk/src/main/java/org/nuiton/mail/plugin/SendEmailMojo.java trunk/src/main/resources/META-INF/plexus/components.xml Log: [ANOMALIE #60] : rendre le plugin compatible 2.2.x Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2009-09-25 21:40:16 UTC (rev 587) +++ trunk/pom.xml 2009-09-25 21:59:57 UTC (rev 588) @@ -56,24 +56,27 @@ </dependency> <dependency> - <optional>true</optional> <groupId>org.sonatype.plexus</groupId> <artifactId>plexus-sec-dispatcher</artifactId> <version>1.3.1</version> </dependency> <dependency> - <optional>true</optional> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-cipher</artifactId> + <version>1.5</version> + </dependency> + + <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-container-default</artifactId> <version>1.0-alpha-9-stable-1</version> </dependency> <dependency> - <optional>true</optional> <groupId>plexus</groupId> <artifactId>plexus-mail-sender-api</artifactId> - <version>1.0-alpha-2</version> + <version>${plexusMailSender.version}</version> <exclusions> <exclusion> <groupId>plexus</groupId> @@ -83,10 +86,9 @@ </dependency> <dependency> - <optional>true</optional> <groupId>plexus</groupId> <artifactId>plexus-mail-sender-javamail</artifactId> - <version>1.0-alpha-2</version> + <version>${plexusMailSender.version}</version> <exclusions> <exclusion> <groupId>plexus</groupId> @@ -96,10 +98,9 @@ </dependency> <dependency> - <optional>true</optional> <groupId>plexus</groupId> <artifactId>plexus-mail-sender-simple</artifactId> - <version>1.0-alpha-2</version> + <version>${plexusMailSender.version}</version> <exclusions> <exclusion> <groupId>plexus</groupId> @@ -118,12 +119,19 @@ </dependency> <dependency> <groupId>org.apache.maven</groupId> - <artifactId>maven-core</artifactId> + <artifactId>maven-model</artifactId> <version>${maven.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.maven</groupId> + <artifactId>maven-settings</artifactId> + <version>${maven.version}</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>org.apache.maven</groupId> <artifactId>maven-artifact</artifactId> <version>${maven.version}</version> <scope>provided</scope> @@ -184,7 +192,7 @@ <name>Maven helper plugin</name> <description>Plugin d'aide pour les projets nuiton</description> <inceptionYear>2009</inceptionYear> - <url>http://maven-site.nuiton.org/${project.artifactId}</url> + <url>http://maven-site.nuiton.org/maven-helper-plugin</url> <organization> <name>CodeLutin</name> @@ -234,7 +242,9 @@ <listId>${project.artifactId}</listId> - <maven.version>2.1.0</maven.version> + <maven.version>2.2.1</maven.version> + <plexusMailSender.version>1.0-alpha-2</plexusMailSender.version> + <javadoc.version>2.4</javadoc.version> <maven.src.dir>${basedir}/src</maven.src.dir> <maven.compile.source>1.6</maven.compile.source> @@ -250,8 +260,6 @@ <!-- to activate generation of reports and javadoc when doing a site --> <maven.reports.generate>true</maven.reports.generate> - <javadoc.version>2.4</javadoc.version> - <license.licenseName>lgpl_v3</license.licenseName> <repository.home.url>http://maven.nuiton.org/release</repository.home.url> @@ -583,6 +591,11 @@ <version>2.5</version> </plugin> + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <version>1.3</version> + </plugin> + </plugins> </pluginManagement> </build> @@ -981,6 +994,39 @@ <maven.reports.dependencyLocationsEnabled>false</maven.reports.dependencyLocationsEnabled> </properties> </profile> + + <!--profile> + <id>run-its</id> + <build> + <plugins> + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <configuration> + <pomIncludes> + <pomInclude>collect-files/single/pom.xml</pomInclude> + <pomInclude>collect-files/multi/pom.xml</pomInclude> + <pomInclude>send-email/single/pom.xml</pomInclude> + </pomIncludes> + <postBuildHookScript>verify</postBuildHookScript> + <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath> + <settingsFile>src/it/settings.xml</settingsFile> + <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo> + </configuration> + <executions> + <execution> + <id>integration-test</id> + <goals> + <goal>install</goal> + <goal>run</goal> + </goals> + <phase>integration-test</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile--> + </profiles> </project> Added: trunk/src/main/java/org/nuiton/components/cipher/DefaultPlexusCipher.java =================================================================== --- trunk/src/main/java/org/nuiton/components/cipher/DefaultPlexusCipher.java (rev 0) +++ trunk/src/main/java/org/nuiton/components/cipher/DefaultPlexusCipher.java 2009-09-25 21:59:57 UTC (rev 588) @@ -0,0 +1,220 @@ +package org.nuiton.components.cipher; + +import org.codehaus.plexus.logging.AbstractLogEnabled; + +import java.security.Provider; +import java.security.Security; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.sonatype.plexus.components.cipher.PBECipher; +import org.sonatype.plexus.components.cipher.PlexusCipher; +import org.sonatype.plexus.components.cipher.PlexusCipherException; + +/** + * This class was forked from plexus-cipher:1.4. + * + * Since maven 2.2.x can not use this plexus component in a mojo + * from the original artifact. + * + * @plexus.component role="org.sonatype.plexus.components.cipher.PlexusCipher" role-hint="maven-helper-plugin" + * @author Oleg Gusakov</a> + */ +public class DefaultPlexusCipher +extends AbstractLogEnabled +implements PlexusCipher +{ + + private static final Pattern ENCRYPTED_STRING_PATTERN = Pattern.compile( ".*?[^\\\\]?\\{(.*?[^\\\\])\\}.*" ); + + private final PBECipher _cipher; + + // --------------------------------------------------------------- + public DefaultPlexusCipher() + throws PlexusCipherException + { + _cipher = new PBECipher(); + } + // --------------------------------------------------------------- + public String encrypt( final String str, final String passPhrase ) + throws PlexusCipherException + { + if ( str == null || str.length() < 1 ) + { + return str; + } + + return _cipher.encrypt64( str, passPhrase ); + } + + // --------------------------------------------------------------- + public String encryptAndDecorate( final String str, final String passPhrase ) + throws PlexusCipherException + { + return decorate( encrypt( str, passPhrase ) ); + } + + // --------------------------------------------------------------- + public String decrypt( final String str, final String passPhrase ) + throws PlexusCipherException + { + if ( str == null || str.length() < 1 ) + { + return str; + } + + return _cipher.decrypt64( str, passPhrase ); + } + + // --------------------------------------------------------------- + public String decryptDecorated( final String str, final String passPhrase ) + throws PlexusCipherException + { + if ( str == null || str.length() < 1 ) + { + return str; + } + + if ( isEncryptedString( str ) ) + { + return decrypt( unDecorate( str ), passPhrase ); + } + + return decrypt( str, passPhrase ); + } + + // ---------------------------------------------------------------------------- + public boolean isEncryptedString( final String str ) + { + if ( str == null || str.length() < 1 ) + { + return false; + } + + Matcher matcher = ENCRYPTED_STRING_PATTERN.matcher( str ); + + return matcher.matches() || matcher.find(); + } + + // ---------------------------------------------------------------------------- + // ------------------- + public String unDecorate( final String str ) + throws PlexusCipherException + { + Matcher matcher = ENCRYPTED_STRING_PATTERN.matcher( str ); + + if ( matcher.matches() || matcher.find() ) + { + return matcher.group( 1 ); + } + else + { + throw new PlexusCipherException( "default.plexus.cipher.badEncryptedPassword" ); + } + } + + // ---------------------------------------------------------------------------- + // ------------------- + public String decorate( final String str ) + { + return ENCRYPTED_STRING_DECORATION_START + ( str == null ? "" : str ) + ENCRYPTED_STRING_DECORATION_STOP; + } + + // --------------------------------------------------------------- + // --------------------------------------------------------------- + // *************************************************************** + /** + * Exploratory part. This method returns all available services types + */ + public static String[] getServiceTypes() + { + Set result = new HashSet(); + + // All all providers + Provider[] providers = Security.getProviders(); + for ( int i = 0; i < providers.length; i++ ) + { + // Get services provided by each provider + Set keys = providers[i].keySet(); + for ( Iterator it = keys.iterator(); it.hasNext(); ) + { + String key = (String) it.next(); + key = key.split( " " )[0]; + + if ( key.startsWith( "Alg.Alias." ) ) + { + // Strip the alias + key = key.substring( 10 ); + } + int ix = key.indexOf( '.' ); + result.add( key.substring( 0, ix ) ); + } + } + return (String[]) result.toArray( new String[result.size()] ); + } + + /** + * This method returns the available implementations for a service type + */ + public static String[] getCryptoImpls( final String serviceType ) + { + Set result = new HashSet(); + + // All all providers + Provider[] providers = Security.getProviders(); + for ( int i = 0; i < providers.length; i++ ) + { + // Get services provided by each provider + Set keys = providers[i].keySet(); + for ( Iterator it = keys.iterator(); it.hasNext(); ) + { + String key = (String) it.next(); + key = key.split( " " )[0]; + + if ( key.startsWith( serviceType + "." ) ) + { + result.add( key.substring( serviceType.length() + 1 ) ); + } + else if ( key.startsWith( "Alg.Alias." + serviceType + "." ) ) + { + // This is an alias + result.add( key.substring( serviceType.length() + 11 ) ); + } + } + } + return (String[]) result.toArray( new String[result.size()] ); + } + + // --------------------------------------------------------------- + public static void main( final String[] args ) + { +// Security.addProvider( new BouncyCastleProvider() ); + + String[] serviceTypes = getServiceTypes(); + if ( serviceTypes != null ) + { + for ( int i = 0; i < serviceTypes.length; i++ ) + { + String serviceType = serviceTypes[i]; + String[] serviceProviders = getCryptoImpls( serviceType ); + if ( serviceProviders != null ) + { + System.out.println( serviceType + ": provider list" ); + for ( int j = 0; j < serviceProviders.length; j++ ) + { + String provider = serviceProviders[j]; + System.out.println( " " + provider ); + } + } + else + { + System.out.println( serviceType + ": does not have any providers in this environment" ); + } + } + } + } + //--------------------------------------------------------------- + //--------------------------------------------------------------- +} Property changes on: trunk/src/main/java/org/nuiton/components/cipher/DefaultPlexusCipher.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Added: trunk/src/main/java/org/nuiton/components/sec/dispatcher/DefaultSecDispatcher.java =================================================================== --- trunk/src/main/java/org/nuiton/components/sec/dispatcher/DefaultSecDispatcher.java (rev 0) +++ trunk/src/main/java/org/nuiton/components/sec/dispatcher/DefaultSecDispatcher.java 2009-09-25 21:59:57 UTC (rev 588) @@ -0,0 +1,321 @@ +package org.nuiton.components.sec.dispatcher; + + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.HashMap; +import java.util.Map; +import java.util.StringTokenizer; + +import org.codehaus.plexus.logging.AbstractLogEnabled; +import org.sonatype.plexus.components.cipher.DefaultPlexusCipher; +import org.sonatype.plexus.components.cipher.PlexusCipher; +import org.sonatype.plexus.components.cipher.PlexusCipherException; +import org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor; +import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher; +import org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException; +import org.sonatype.plexus.components.sec.dispatcher.SecUtil; +import org.sonatype.plexus.components.sec.dispatcher.model.SettingsSecurity; + +/** + * This class was forked from plexus-sec-dispatcher:1.3.1. + * + * Since maven 2.2.x can not use this plexus component in a mojo + * from the original artifact. + * + * @plexus.component role-hint="maven-helper-plugin" + * @author Oleg Gusakov</a> + */ +public class DefaultSecDispatcher +extends AbstractLogEnabled +implements SecDispatcher +{ + public static final String SYSTEM_PROPERTY_SEC_LOCATION = "settings.security"; + + public static final String TYPE_ATTR = "type"; + + public static final char ATTR_START = '['; + + public static final char ATTR_STOP = ']'; + + /** + * DefaultHandler + * + * @plexus.requirement role-hint="maven-helper-plugin" + */ + protected PlexusCipher _cipher; + + /** + * All available dispatchers + * + * @plexus.requirement role="org.sonatype.plexus.components.sec.dispatcher.PasswordDecryptor" + */ + protected Map _decryptors; + + /** + * + * @plexus.configuration default-value="~/.settings-security.xml" + */ + protected String _configurationFile = "~/.settings-security.xml"; + + // --------------------------------------------------------------- + public String decrypt( String str ) + throws SecDispatcherException + { + if( ! isEncryptedString( str ) ) + return str; + + String bare = null; + + try + { + bare = _cipher.unDecorate( str ); + } + catch ( PlexusCipherException e1 ) + { + throw new SecDispatcherException( e1 ); + } + + try + { + Map attr = stripAttributes( bare ); + + String res = null; + + SettingsSecurity sec = getSec(); + + if( attr == null || attr.get( "type" ) == null ) + { + String master = getMaster( sec ); + + res = _cipher.decrypt( bare, master ); + } + else + { + String type = (String) attr.get( TYPE_ATTR ); + + if( _decryptors == null ) + throw new SecDispatcherException( "plexus container did not supply any required dispatchers - cannot lookup "+type ); + + Map conf = SecUtil.getConfig( sec, type ); + + PasswordDecryptor dispatcher = (PasswordDecryptor) _decryptors.get( type ); + + if( dispatcher == null ) + throw new SecDispatcherException( "no dispatcher for hint "+type ); + + String pass = attr == null ? bare : strip( bare ); + + return dispatcher.decrypt( pass, attr, conf ); + } + + return res; + } + catch ( Exception e ) + { + throw new SecDispatcherException(e); + } + } + + private String strip( String str ) + { + int pos = str.indexOf( ATTR_STOP ); + + if( pos == str.length() ) + return null; + + if( pos != -1 ) + return str.substring( pos+1 ); + + return str; + } + + private Map stripAttributes( String str ) + { + int start = str.indexOf( ATTR_START ); + int stop = str.indexOf( ATTR_STOP ); + if ( start != -1 && stop != -1 && stop > start ) + { + if( stop == start+1 ) + return null; + + String attrs = str.substring( start+1, stop ).trim(); + + if( attrs == null || attrs.length() < 1 ) + return null; + + Map res = null; + + StringTokenizer st = new StringTokenizer( attrs, ", " ); + + while( st.hasMoreTokens() ) + { + if( res == null ) + res = new HashMap( st.countTokens() ); + + String pair = st.nextToken(); + + int pos = pair.indexOf( '=' ); + + if( pos == -1 ) + continue; + + String key = pair.substring( 0, pos ).trim(); + + if( pos == pair.length() ) + { + res.put( key, null ); + continue; + } + + String val = pair.substring( pos+1 ); + + res.put( key, val.trim() ); + } + + return res; + } + + return null; + } + //---------------------------------------------------------------------------- + private boolean isEncryptedString( String str ) + { + if( str == null ) + return false; + + return _cipher.isEncryptedString( str ); + } + //---------------------------------------------------------------------------- + private SettingsSecurity getSec() + throws SecDispatcherException + { + String location = System.getProperty( SYSTEM_PROPERTY_SEC_LOCATION + , getConfigurationFile() + ); + String realLocation = location.charAt( 0 ) == '~' + ? System.getProperty( "user.home" ) + location.substring( 1 ) + : location + ; + + SettingsSecurity sec = SecUtil.read( realLocation, true ); + + if( sec == null ) + throw new SecDispatcherException( "cannot retrieve master password. Please check that "+realLocation+" exists and has data" ); + + return sec; + } + //---------------------------------------------------------------------------- + private String getMaster( SettingsSecurity sec ) + throws SecDispatcherException + { + String master = sec.getMaster(); + + if( master == null ) + throw new SecDispatcherException( "master password is not set" ); + + try + { + return _cipher.decryptDecorated( master, SYSTEM_PROPERTY_SEC_LOCATION ); + } + catch ( PlexusCipherException e ) + { + throw new SecDispatcherException(e); + } + } + //--------------------------------------------------------------- + public String getConfigurationFile() + { + return _configurationFile; + } + + public void setConfigurationFile( String file ) + { + _configurationFile = file; + } + //---------------------------------------------------------------------------- + // *************************************************************** + /** + * Encrytion helper + * @throws IOException + */ + + //--------------------------------------------------------------- + private static boolean propertyExists( String [] values, String [] av ) + { + if( values != null ) + { + for( int i=0; i< values.length; i++ ) + { + String p = System.getProperty( values[i] ); + + if( p != null ) + return true; + } + + if( av != null ) + for( int i=0; i< values.length; i++ ) + for( int j=0; j< av.length; j++ ) + { + if( ("--"+values[i]).equals( av[j] ) ) + return true; + } + } + + return false; + } + + private static final void usage() + { + System.out.println("usage: java -jar ...jar [-m|-p]\n-m: encrypt master password\n-p: encrypt password"); + } + //--------------------------------------------------------------- + public static void main( String[] args ) + throws Exception + { + if( args == null || args.length < 1 ) + { + usage(); + return; + } + + if( "-m".equals( args[0] ) || propertyExists( SYSTEM_PROPERTY_MASTER_PASSWORD, args ) ) + show( true ); + else if( "-p".equals( args[0] ) || propertyExists( SYSTEM_PROPERTY_SERVER_PASSWORD, args ) ) + show( false ); + else + usage(); + } + //--------------------------------------------------------------- + private static void show( boolean showMaster ) + throws Exception + { + if( showMaster ) + System.out.print("\nsettings master password\n"); + else + System.out.print("\nsettings server password\n"); + + System.out.print("enter password: "); + + BufferedReader r = new BufferedReader( new InputStreamReader( System.in ) ); + + String pass = r.readLine(); + + System.out.println("\n"); + + DefaultPlexusCipher dc = new DefaultPlexusCipher(); + DefaultSecDispatcher dd = new DefaultSecDispatcher(); + dd._cipher = dc; + + if( showMaster ) + System.out.println( dc.encryptAndDecorate( pass, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ) ); + else + { + SettingsSecurity sec = dd.getSec(); + System.out.println( dc.encryptAndDecorate( pass, dd.getMaster(sec) ) ); + } + } + //--------------------------------------------------------------- + //--------------------------------------------------------------- +} Property changes on: trunk/src/main/java/org/nuiton/components/sec/dispatcher/DefaultSecDispatcher.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Modified: trunk/src/main/java/org/nuiton/mail/plugin/SendEmailMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/mail/plugin/SendEmailMojo.java 2009-09-25 21:40:16 UTC (rev 587) +++ trunk/src/main/java/org/nuiton/mail/plugin/SendEmailMojo.java 2009-09-25 21:59:57 UTC (rev 588) @@ -27,7 +27,6 @@ import java.io.File; import java.util.List; -import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Developer; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; @@ -52,18 +51,12 @@ public class SendEmailMojo extends AbstractPlugin { /** - * @parameter expression="${session}" - * @required - * @readonly - */ - protected MavenSession mavenSession; - /** * Dependance du projet. * * @parameter default-value="${project}" * @required * @readonly - * @since 1.0.0 + * @since 1.0.3 */ protected MavenProject project; /** @@ -72,14 +65,14 @@ * @parameter default-value="${settings}" * @required * @readonly - * @since 1.0.0 + * @since 1.0.3 */ protected Settings settings; /** * Un flag pour activer le mode verbeux. * * @parameter expression="${helper.verbose}" default-value="${maven.verbose}" - * @since 1.0.0 + * @since 1.0.3 */ protected boolean verbose; /** @@ -87,7 +80,7 @@ * * @parameter expression="${helper.emailContentFile}" * @required - * @since 1.0.0 + * @since 1.0.3 */ private File emailContentFile; /** @@ -95,7 +88,7 @@ * * @parameter expression="${helper.emailTitle}" * @required - * @since 1.0.0 + * @since 1.0.3 */ private String emailTitle; /** @@ -103,6 +96,7 @@ * * @parameter expression="${helper.smtpHost}" * @required + * @since 1.0.3 */ private String smtpHost; /** @@ -110,18 +104,21 @@ * * @parameter default-value="25" expression="${helper.smtpPort}" * @required + * @since 1.0.3 */ private int smtpPort; /** * The username used to send the email. * * @parameter expression="${helper.username}" + * @since 1.0.3 */ private String username; /** * The password used to send the email. * * @parameter expression="${helper.password}" + * @since 1.0.3 */ private String password; /** @@ -130,13 +127,14 @@ * <p/> * * @parameter expression="${helper.serverId}" - * @since 1.0.0 + * @since 1.0.3 */ protected String serverId; /** * If the email should be sent in SSL mode. * * @parameter default-value="false" expression="${helper.sslMode}" + * @since 1.0.3 */ private boolean sslMode; /** @@ -146,6 +144,7 @@ * used. * * @parameter expression="${helper.fromDeveloperId}" + * @since 1.0.3 */ private String fromDeveloperId; /** @@ -153,6 +152,7 @@ * if the sender is not a member of the development team. * * @parameter expression="${helper.mailSender}" + * @since 1.0.3 */ private MailSender mailSender; /** @@ -160,6 +160,7 @@ * * @parameter * @required + * @since 1.0.3 */ private List<String> toAddresses; /** @@ -168,48 +169,49 @@ * @parameter expression="${project.developers}" * @required * @readonly + * @since 1.0.3 */ private List<Developer> from; /** * Mail content type to use. * @parameter default-value="text/plain" * @required - * @since 2.1 + * @since 1.0.3 */ private String mailContentType; /** * The encoding used to read and write files. * * @parameter expression="${helper.encoding}" default-value="${project.build.sourceEncoding}" - * @since 1.0.0 + * @since 1.0.3 */ protected String encoding; /** * A flag to skip the goal. * * @parameter expression="${helper.skipSendEmail}" default-value="false" - * @since 1.0.0 + * @since 1.0.3 */ private boolean skipSendEmail; /** * A flag to test plugin but send nothing to redmine. * * @parameter expression="${dryRun}" default-value="false" - * @since 1.0.0 + * @since 1.0.3 */ protected boolean dryRun; /** * A flag to restirct only one run in a build (for multi-module context). * * @parameter expression="${redmine.runOnce}" default-value="true" - * @since 1.0.0 + * @since 1.0.3 */ private boolean runOnce; /** * password decypher * * @component roleHint="maven-helper-plugin" - * @since 1.0.0 + * @since 1.0.3 */ protected SecDispatcher sec; private boolean runOnceDone; @@ -454,24 +456,6 @@ } protected boolean isExecutionRoot() { - return project == getExecutionRootProject(); + return project.isExecutionRoot(); } - - protected MavenProject getExecutionRootProject() { - MavenProject root = project; - String executionRootDirectory = mavenSession.getExecutionRootDirectory(); - while (root != null) { - File dir = root.getBasedir(); - getLog().debug("Current Folder:" + dir); - boolean result = executionRootDirectory.equalsIgnoreCase(dir.toString()); - if (result) { - break; - } - root = root.getParent(); - } - if (verbose) { - getLog().info("root project " + root); - } - return root; - } } Modified: trunk/src/main/resources/META-INF/plexus/components.xml =================================================================== --- trunk/src/main/resources/META-INF/plexus/components.xml 2009-09-25 21:40:16 UTC (rev 587) +++ trunk/src/main/resources/META-INF/plexus/components.xml 2009-09-25 21:59:57 UTC (rev 588) @@ -20,9 +20,14 @@ <component-set> <components> <component> + <role>org.sonatype.plexus.components.cipher.PlexusCipher</role> + <role-hint>maven-helper-plugin</role-hint> + <implementation>org.nuiton.components.cipher.DefaultPlexusCipher</implementation> + </component> + <component> <role>org.sonatype.plexus.components.sec.dispatcher.SecDispatcher</role> <role-hint>maven-helper-plugin</role-hint> - <implementation>org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher</implementation> + <implementation>org.nuiton.components.sec.dispatcher.DefaultSecDispatcher</implementation> <requirements> <requirement> <role>org.sonatype.plexus.components.cipher.PlexusCipher</role>
participants (1)
-
tchemit@users.nuiton.org