]> source.dussan.org Git - archiva.git/blob
9e0c49c5915ae40427dee240923bd42762d2eace
[archiva.git] /
1 package org.apache.archiva.converter.artifact;
2
3 /*
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements.  See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership.  The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License.  You may obtain a copy of the License at
11  *
12  *  http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied.  See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  */
21
22 import org.apache.archiva.common.plexusbridge.DigesterUtils;
23 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
24 import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
25 import org.apache.archiva.transaction.FileTransaction;
26 import org.apache.archiva.transaction.TransactionException;
27 import org.apache.commons.io.FileUtils;
28 import org.apache.maven.artifact.Artifact;
29 import org.apache.maven.artifact.factory.ArtifactFactory;
30 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
31 import org.apache.maven.artifact.repository.ArtifactRepository;
32 import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata;
33 import org.apache.maven.artifact.repository.metadata.Metadata;
34 import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
35 import org.apache.maven.artifact.repository.metadata.Snapshot;
36 import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata;
37 import org.apache.maven.artifact.repository.metadata.Versioning;
38 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
39 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Writer;
40 import org.apache.maven.model.DistributionManagement;
41 import org.apache.maven.model.Model;
42 import org.apache.maven.model.Relocation;
43 import org.apache.maven.model.converter.ModelConverter;
44 import org.apache.maven.model.converter.PomTranslationException;
45 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
46 import org.codehaus.plexus.digest.Digester;
47 import org.codehaus.plexus.digest.DigesterException;
48 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
49 import org.springframework.stereotype.Service;
50
51 import javax.annotation.PostConstruct;
52 import javax.inject.Inject;
53 import java.io.IOException;
54 import java.io.Reader;
55 import java.io.StringReader;
56 import java.io.StringWriter;
57 import java.nio.charset.Charset;
58 import java.nio.file.Files;
59 import java.nio.file.Path;
60 import java.nio.file.Paths;
61 import java.util.ArrayList;
62 import java.util.HashMap;
63 import java.util.List;
64 import java.util.Map;
65 import java.util.Properties;
66 import java.util.regex.Matcher;
67
68 /**
69  * LegacyToDefaultConverter
70  */
71 @Service("artifactConverter#legacy-to-default")
72 public class LegacyToDefaultConverter
73     implements ArtifactConverter
74 {
75     /**
76      * {@link List}<{@link Digester}
77      */
78     private List<? extends Digester> digesters;
79
80     @Inject
81     private PlexusSisuBridge plexusSisuBridge;
82
83     @Inject
84     private DigesterUtils digesterUtils;
85
86     private ModelConverter translator;
87
88     private ArtifactFactory artifactFactory;
89
90     private ArtifactHandlerManager artifactHandlerManager;
91
92     private boolean force;
93
94     private boolean dryrun;
95
96     private Map<Artifact, List<String>> warnings = new HashMap<>();
97
98     @PostConstruct
99     public void initialize()
100         throws PlexusSisuBridgeException
101     {
102         this.digesters = digesterUtils.getAllDigesters();
103         translator = plexusSisuBridge.lookup( ModelConverter.class );
104         artifactFactory = plexusSisuBridge.lookup( ArtifactFactory.class );
105         artifactHandlerManager = plexusSisuBridge.lookup( ArtifactHandlerManager.class );
106     }
107
108     @Override
109     public void convert( Artifact artifact, ArtifactRepository targetRepository )
110         throws ArtifactConversionException
111     {
112         if ( artifact.getRepository().getUrl().equals( targetRepository.getUrl() ) )
113         {
114             throw new ArtifactConversionException( Messages.getString( "exception.repositories.match" ) ); //$NON-NLS-1$
115         }
116
117         if ( !validateMetadata( artifact ) )
118         {
119             addWarning( artifact, Messages.getString( "unable.to.validate.metadata" ) ); //$NON-NLS-1$
120             return;
121         }
122
123         FileTransaction transaction = new FileTransaction();
124
125         if ( !copyPom( artifact, targetRepository, transaction ) )
126         {
127             addWarning( artifact, Messages.getString( "unable.to.copy.pom" ) ); //$NON-NLS-1$
128             return;
129         }
130
131         if ( !copyArtifact( artifact, targetRepository, transaction ) )
132         {
133             addWarning( artifact, Messages.getString( "unable.to.copy.artifact" ) ); //$NON-NLS-1$
134             return;
135         }
136
137         Metadata metadata = createBaseMetadata( artifact );
138         Versioning versioning = new Versioning();
139         versioning.addVersion( artifact.getBaseVersion() );
140         metadata.setVersioning( versioning );
141         updateMetadata( new ArtifactRepositoryMetadata( artifact ), targetRepository, metadata, transaction );
142
143         metadata = createBaseMetadata( artifact );
144         metadata.setVersion( artifact.getBaseVersion() );
145         versioning = new Versioning();
146
147         Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher( artifact.getVersion() );
148         if ( matcher.matches() )
149         {
150             Snapshot snapshot = new Snapshot();
151             snapshot.setBuildNumber( Integer.parseInt( matcher.group( 3 ) ) );
152             snapshot.setTimestamp( matcher.group( 2 ) );
153             versioning.setSnapshot( snapshot );
154         }
155
156         // TODO: merge latest/release/snapshot from source instead
157         metadata.setVersioning( versioning );
158         updateMetadata( new SnapshotArtifactRepositoryMetadata( artifact ), targetRepository, metadata, transaction );
159
160         if ( !dryrun )
161         {
162             try
163             {
164                 transaction.commit();
165             }
166             catch ( TransactionException e )
167             {
168                 throw new ArtifactConversionException( Messages.getString( "transaction.failure", e.getMessage() ),
169                                                        e ); //$NON-NLS-1$
170             }
171         }
172     }
173
174     @SuppressWarnings("unchecked")
175     private boolean copyPom( Artifact artifact, ArtifactRepository targetRepository, FileTransaction transaction )
176         throws ArtifactConversionException
177     {
178         Artifact pom = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(),
179                                                               artifact.getVersion() );
180         pom.setBaseVersion( artifact.getBaseVersion() );
181         ArtifactRepository repository = artifact.getRepository();
182         Path file = Paths.get( repository.getBasedir(), repository.pathOf( pom ) );
183
184         boolean result = true;
185         if ( Files.exists(file) )
186         {
187             Path targetFile = Paths.get( targetRepository.getBasedir(), targetRepository.pathOf( pom ) );
188
189             String contents = null;
190             boolean checksumsValid = false;
191             try
192             {
193                 if ( testChecksums( artifact, file ) )
194                 {
195                     checksumsValid = true;
196                 }
197
198                 // Even if the checksums for the POM are invalid we should still convert the POM
199                 contents = org.apache.archiva.common.utils.FileUtils.readFileToString( file, Charset.defaultCharset() );
200             }
201             catch ( IOException e )
202             {
203                 throw new ArtifactConversionException(
204                     Messages.getString( "unable.to.read.source.pom", e.getMessage() ), e ); //$NON-NLS-1$
205             }
206
207             if ( checksumsValid && contents.indexOf( "modelVersion" ) >= 0 ) //$NON-NLS-1$
208             {
209                 // v4 POM
210                 boolean matching = false;
211                 if ( !force && Files.exists( targetFile ) )
212                 {
213                     String targetContents = org.apache.archiva.common.utils.FileUtils.readFileToString( targetFile, Charset.defaultCharset( ) );
214                     matching = targetContents.equals( contents );
215                 }
216                 if ( force || !matching )
217                 {
218                     transaction.createFile( contents, targetFile.toFile( ), digesters );
219                 }
220             }
221             else
222             {
223                 // v3 POM
224                 try (StringReader stringReader = new StringReader( contents ))
225                 {
226
227                     try (StringWriter writer = new StringWriter())
228                     {
229                         org.apache.maven.model.v3_0_0.io.xpp3.MavenXpp3Reader v3Reader =
230                             new org.apache.maven.model.v3_0_0.io.xpp3.MavenXpp3Reader();
231                         org.apache.maven.model.v3_0_0.Model v3Model = v3Reader.read( stringReader );
232
233                         if ( doRelocation( artifact, v3Model, targetRepository, transaction ) )
234                         {
235                             Artifact relocatedPom =
236                                 artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(),
237                                                                        artifact.getVersion() );
238                             targetFile =
239                                 Paths.get( targetRepository.getBasedir(), targetRepository.pathOf( relocatedPom ) );
240                         }
241
242                         Model v4Model = translator.translate( v3Model );
243
244                         translator.validateV4Basics( v4Model, v3Model.getGroupId(), v3Model.getArtifactId(),
245                                                      v3Model.getVersion(), v3Model.getPackage() );
246
247                         MavenXpp3Writer xpp3Writer = new MavenXpp3Writer();
248                         xpp3Writer.write( writer, v4Model );
249
250                         transaction.createFile( writer.toString(), targetFile.toFile(), digesters );
251
252                         List<String> warnings = translator.getWarnings();
253
254                         for ( String message : warnings )
255                         {
256                             addWarning( artifact, message );
257                         }
258                     }
259                     catch ( XmlPullParserException e )
260                     {
261                         addWarning( artifact,
262                                     Messages.getString( "invalid.source.pom", e.getMessage() ) ); //$NON-NLS-1$
263                         result = false;
264                     }
265                     catch ( IOException e )
266                     {
267                         throw new ArtifactConversionException( Messages.getString( "unable.to.write.converted.pom" ),
268                                                                e ); //$NON-NLS-1$
269                     }
270                     catch ( PomTranslationException e )
271                     {
272                         addWarning( artifact,
273                                     Messages.getString( "invalid.source.pom", e.getMessage() ) ); //$NON-NLS-1$
274                         result = false;
275                     }
276                 }
277             }
278         }
279         else
280         {
281             addWarning( artifact, Messages.getString( "warning.missing.pom" ) ); //$NON-NLS-1$
282         }
283         return result;
284     }
285
286     private boolean testChecksums( Artifact artifact, Path file )
287         throws IOException
288     {
289         boolean result = true;
290         for ( Digester digester : digesters )
291         {
292             result &= verifyChecksum( file, file.getFileName() + "." + getDigesterFileExtension( digester ), digester,
293                                       //$NON-NLS-1$
294                                       artifact,
295                                       "failure.incorrect." + getDigesterFileExtension( digester ) ); //$NON-NLS-1$
296         }
297         return result;
298     }
299
300     private boolean verifyChecksum( Path file, String fileName, Digester digester, Artifact artifact, String key )
301         throws IOException
302     {
303         boolean result = true;
304
305         Path checksumFile = file.resolveSibling( fileName );
306         if ( Files.exists(checksumFile) )
307         {
308             String checksum = org.apache.archiva.common.utils.FileUtils.readFileToString( checksumFile, Charset.defaultCharset() );
309             try
310             {
311                 digester.verify( file.toFile(), checksum );
312             }
313             catch ( DigesterException e )
314             {
315                 addWarning( artifact, Messages.getString( key ) );
316                 result = false;
317             }
318         }
319         return result;
320     }
321
322     /**
323      * File extension for checksums
324      * TODO should be moved to plexus-digester ?
325      */
326     private String getDigesterFileExtension( Digester digester )
327     {
328         return digester.getAlgorithm().toLowerCase().replaceAll( "-", "" ); //$NON-NLS-1$ //$NON-NLS-2$
329     }
330
331     private boolean copyArtifact( Artifact artifact, ArtifactRepository targetRepository, FileTransaction transaction )
332         throws ArtifactConversionException
333     {
334         Path sourceFile = artifact.getFile().toPath();
335
336         if ( sourceFile.toAbsolutePath().toString().indexOf( "/plugins/" ) > -1 ) //$NON-NLS-1$
337         {
338             artifact.setArtifactHandler( artifactHandlerManager.getArtifactHandler( "maven-plugin" ) ); //$NON-NLS-1$
339         }
340
341         Path targetFile = Paths.get( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) );
342
343         boolean result = true;
344         try
345         {
346             boolean matching = false;
347             if ( !force && Files.exists(targetFile) )
348             {
349                 matching = FileUtils.contentEquals( sourceFile.toFile(), targetFile.toFile() );
350                 if ( !matching )
351                 {
352                     addWarning( artifact, Messages.getString( "failure.target.already.exists" ) ); //$NON-NLS-1$
353                     result = false;
354                 }
355             }
356             if ( result )
357             {
358                 if ( force || !matching )
359                 {
360                     if ( testChecksums( artifact, sourceFile ) )
361                     {
362                         transaction.copyFile( sourceFile.toFile(), targetFile.toFile(), digesters );
363                     }
364                     else
365                     {
366                         result = false;
367                     }
368                 }
369             }
370         }
371         catch ( IOException e )
372         {
373             throw new ArtifactConversionException( Messages.getString( "error.copying.artifact" ), e ); //$NON-NLS-1$
374         }
375         return result;
376     }
377
378     private Metadata createBaseMetadata( Artifact artifact )
379     {
380         Metadata metadata = new Metadata();
381         metadata.setArtifactId( artifact.getArtifactId() );
382         metadata.setGroupId( artifact.getGroupId() );
383         return metadata;
384     }
385
386     private Metadata readMetadata( Path file )
387         throws ArtifactConversionException
388     {
389         MetadataXpp3Reader reader = new MetadataXpp3Reader();
390
391         try (Reader fileReader = Files.newBufferedReader( file, Charset.defaultCharset() ))
392         {
393             return reader.read( fileReader );
394         }
395         catch ( IOException | XmlPullParserException e )
396         {
397             throw new ArtifactConversionException( Messages.getString( "error.reading.target.metadata" ),
398                                                    e ); //$NON-NLS-1$
399         }
400     }
401
402     private boolean validateMetadata( Artifact artifact )
403         throws ArtifactConversionException
404     {
405         ArtifactRepository repository = artifact.getRepository();
406
407         boolean result = true;
408
409         RepositoryMetadata repositoryMetadata = new ArtifactRepositoryMetadata( artifact );
410         Path file = Paths.get( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ) );
411         if ( Files.exists(file) )
412         {
413             Metadata metadata = readMetadata( file );
414             result = validateMetadata( metadata, repositoryMetadata, artifact );
415         }
416
417         repositoryMetadata = new SnapshotArtifactRepositoryMetadata( artifact );
418         file = Paths.get( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ) );
419         if ( Files.exists(file) )
420         {
421             Metadata metadata = readMetadata( file );
422             result = result && validateMetadata( metadata, repositoryMetadata, artifact );
423         }
424
425         return result;
426     }
427
428     @SuppressWarnings("unchecked")
429     private boolean validateMetadata( Metadata metadata, RepositoryMetadata repositoryMetadata, Artifact artifact )
430     {
431         String groupIdKey;
432         String artifactIdKey = null;
433         String snapshotKey = null;
434         String versionKey = null;
435         String versionsKey = null;
436
437         if ( repositoryMetadata.storedInGroupDirectory() )
438         {
439             groupIdKey = "failure.incorrect.groupMetadata.groupId"; //$NON-NLS-1$
440         }
441         else if ( repositoryMetadata.storedInArtifactVersionDirectory() )
442         {
443             groupIdKey = "failure.incorrect.snapshotMetadata.groupId"; //$NON-NLS-1$
444             artifactIdKey = "failure.incorrect.snapshotMetadata.artifactId"; //$NON-NLS-1$
445             versionKey = "failure.incorrect.snapshotMetadata.version"; //$NON-NLS-1$
446             snapshotKey = "failure.incorrect.snapshotMetadata.snapshot"; //$NON-NLS-1$
447         }
448         else
449         {
450             groupIdKey = "failure.incorrect.artifactMetadata.groupId"; //$NON-NLS-1$
451             artifactIdKey = "failure.incorrect.artifactMetadata.artifactId"; //$NON-NLS-1$
452             versionsKey = "failure.incorrect.artifactMetadata.versions"; //$NON-NLS-1$
453         }
454
455         boolean result = true;
456
457         if ( metadata.getGroupId() == null || !metadata.getGroupId().equals( artifact.getGroupId() ) )
458         {
459             addWarning( artifact, Messages.getString( groupIdKey ) );
460             result = false;
461         }
462         if ( !repositoryMetadata.storedInGroupDirectory() )
463         {
464             if ( metadata.getGroupId() == null || !metadata.getArtifactId().equals( artifact.getArtifactId() ) )
465             {
466                 addWarning( artifact, Messages.getString( artifactIdKey ) );
467                 result = false;
468             }
469             if ( !repositoryMetadata.storedInArtifactVersionDirectory() )
470             {
471                 // artifact metadata
472
473                 boolean foundVersion = false;
474                 if ( metadata.getVersioning() != null )
475                 {
476                     for ( String version : (List<String>) metadata.getVersioning().getVersions() )
477                     {
478                         if ( version.equals( artifact.getBaseVersion() ) )
479                         {
480                             foundVersion = true;
481                             break;
482                         }
483                     }
484                 }
485
486                 if ( !foundVersion )
487                 {
488                     addWarning( artifact, Messages.getString( versionsKey ) );
489                     result = false;
490                 }
491             }
492             else
493             {
494                 // snapshot metadata
495                 if ( !artifact.getBaseVersion().equals( metadata.getVersion() ) )
496                 {
497                     addWarning( artifact, Messages.getString( versionKey ) );
498                     result = false;
499                 }
500
501                 if ( artifact.isSnapshot() )
502                 {
503                     Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher( artifact.getVersion() );
504                     if ( matcher.matches() )
505                     {
506                         boolean correct = false;
507                         if ( metadata.getVersioning() != null && metadata.getVersioning().getSnapshot() != null )
508                         {
509                             Snapshot snapshot = metadata.getVersioning().getSnapshot();
510                             int build = Integer.parseInt( matcher.group( 3 ) );
511                             String ts = matcher.group( 2 );
512                             if ( build == snapshot.getBuildNumber() && ts.equals( snapshot.getTimestamp() ) )
513                             {
514                                 correct = true;
515                             }
516                         }
517
518                         if ( !correct )
519                         {
520                             addWarning( artifact, Messages.getString( snapshotKey ) );
521                             result = false;
522                         }
523                     }
524                 }
525             }
526         }
527         return result;
528     }
529
530     private void updateMetadata( RepositoryMetadata artifactMetadata, ArtifactRepository targetRepository,
531                                  Metadata newMetadata, FileTransaction transaction )
532         throws ArtifactConversionException
533     {
534         Path file = Paths.get( targetRepository.getBasedir(),
535                               targetRepository.pathOfRemoteRepositoryMetadata( artifactMetadata ) );
536
537         Metadata metadata;
538         boolean changed;
539
540         if ( Files.exists(file) )
541         {
542             metadata = readMetadata( file );
543             changed = metadata.merge( newMetadata );
544         }
545         else
546         {
547             changed = true;
548             metadata = newMetadata;
549         }
550
551         if ( changed )
552         {
553
554             try (StringWriter writer = new StringWriter())
555             {
556                 MetadataXpp3Writer mappingWriter = new MetadataXpp3Writer();
557
558                 mappingWriter.write( writer, metadata );
559
560                 transaction.createFile( writer.toString(), file.toFile(), digesters );
561             }
562             catch ( IOException e )
563             {
564                 throw new ArtifactConversionException( Messages.getString( "error.writing.target.metadata" ),
565                                                        e ); //$NON-NLS-1$
566             }
567         }
568     }
569
570     private boolean doRelocation( Artifact artifact, org.apache.maven.model.v3_0_0.Model v3Model,
571                                   ArtifactRepository repository, FileTransaction transaction )
572         throws IOException
573     {
574         Properties properties = v3Model.getProperties();
575         if ( properties.containsKey( "relocated.groupId" ) || properties.containsKey( "relocated.artifactId" )
576             //$NON-NLS-1$ //$NON-NLS-2$
577             || properties.containsKey( "relocated.version" ) ) //$NON-NLS-1$
578         {
579             String newGroupId = properties.getProperty( "relocated.groupId", v3Model.getGroupId() ); //$NON-NLS-1$
580             properties.remove( "relocated.groupId" ); //$NON-NLS-1$
581
582             String newArtifactId =
583                 properties.getProperty( "relocated.artifactId", v3Model.getArtifactId() ); //$NON-NLS-1$
584             properties.remove( "relocated.artifactId" ); //$NON-NLS-1$
585
586             String newVersion = properties.getProperty( "relocated.version", v3Model.getVersion() ); //$NON-NLS-1$
587             properties.remove( "relocated.version" ); //$NON-NLS-1$
588
589             String message = properties.getProperty( "relocated.message", "" ); //$NON-NLS-1$ //$NON-NLS-2$
590             properties.remove( "relocated.message" ); //$NON-NLS-1$
591
592             if ( properties.isEmpty() )
593             {
594                 v3Model.setProperties( null );
595             }
596
597             writeRelocationPom( v3Model.getGroupId(), v3Model.getArtifactId(), v3Model.getVersion(), newGroupId,
598                                 newArtifactId, newVersion, message, repository, transaction );
599
600             v3Model.setGroupId( newGroupId );
601             v3Model.setArtifactId( newArtifactId );
602             v3Model.setVersion( newVersion );
603
604             artifact.setGroupId( newGroupId );
605             artifact.setArtifactId( newArtifactId );
606             artifact.setVersion( newVersion );
607
608             return true;
609         }
610         else
611         {
612             return false;
613         }
614     }
615
616     private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId,
617                                      String newArtifactId, String newVersion, String message,
618                                      ArtifactRepository repository, FileTransaction transaction )
619         throws IOException
620     {
621         Model pom = new Model();
622         pom.setGroupId( groupId );
623         pom.setArtifactId( artifactId );
624         pom.setVersion( version );
625
626         DistributionManagement dMngt = new DistributionManagement();
627
628         Relocation relocation = new Relocation();
629         relocation.setGroupId( newGroupId );
630         relocation.setArtifactId( newArtifactId );
631         relocation.setVersion( newVersion );
632         if ( message != null && message.length() > 0 )
633         {
634             relocation.setMessage( message );
635         }
636
637         dMngt.setRelocation( relocation );
638
639         pom.setDistributionManagement( dMngt );
640
641         Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$
642         Path pomFile = Paths.get( repository.getBasedir(), repository.pathOf( artifact ) );
643
644         StringWriter strWriter = new StringWriter();
645         MavenXpp3Writer pomWriter = new MavenXpp3Writer();
646         pomWriter.write( strWriter, pom );
647
648         transaction.createFile( strWriter.toString(), pomFile.toFile(), digesters );
649     }
650
651     private void addWarning( Artifact artifact, String message )
652     {
653         List<String> messages = warnings.get( artifact );
654         if ( messages == null )
655         {
656             messages = new ArrayList<>( 1 );
657         }
658         messages.add( message );
659         warnings.put( artifact, messages );
660     }
661
662     @Override
663     public void clearWarnings()
664     {
665         warnings.clear();
666     }
667
668     @Override
669     public Map<Artifact, List<String>> getWarnings()
670     {
671         return warnings;
672     }
673
674
675     public List<? extends Digester> getDigesters()
676     {
677         return digesters;
678     }
679
680     public void setDigesters( List<Digester> digesters )
681     {
682         this.digesters = digesters;
683     }
684
685     public ModelConverter getTranslator()
686     {
687         return translator;
688     }
689
690     public void setTranslator( ModelConverter translator )
691     {
692         this.translator = translator;
693     }
694
695     public ArtifactFactory getArtifactFactory()
696     {
697         return artifactFactory;
698     }
699
700     public void setArtifactFactory( ArtifactFactory artifactFactory )
701     {
702         this.artifactFactory = artifactFactory;
703     }
704
705     public ArtifactHandlerManager getArtifactHandlerManager()
706     {
707         return artifactHandlerManager;
708     }
709
710     public void setArtifactHandlerManager( ArtifactHandlerManager artifactHandlerManager )
711     {
712         this.artifactHandlerManager = artifactHandlerManager;
713     }
714
715     public boolean isForce()
716     {
717         return force;
718     }
719
720     public void setForce( boolean force )
721     {
722         this.force = force;
723     }
724
725     public boolean isDryrun()
726     {
727         return dryrun;
728     }
729
730     public void setDryrun( boolean dryrun )
731     {
732         this.dryrun = dryrun;
733     }
734 }