1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.ide;
20
21 import java.io.File;
22 import java.io.IOException;
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.HashMap;
26 import java.util.HashSet;
27 import java.util.Iterator;
28 import java.util.List;
29 import java.util.Map;
30 import java.util.Set;
31 import java.util.TreeSet;
32 import java.util.jar.Attributes;
33 import java.util.jar.JarFile;
34 import java.util.jar.Manifest;
35 import java.util.zip.ZipFile;
36
37 import org.apache.maven.artifact.Artifact;
38 import org.apache.maven.artifact.factory.ArtifactFactory;
39 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
40 import org.apache.maven.artifact.repository.ArtifactRepository;
41 import org.apache.maven.artifact.resolver.ArtifactCollector;
42 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
43 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
44 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
45 import org.apache.maven.artifact.resolver.ArtifactResolver;
46 import org.apache.maven.artifact.resolver.DebugResolutionListener;
47 import org.apache.maven.artifact.resolver.ResolutionNode;
48 import org.apache.maven.artifact.resolver.WarningResolutionListener;
49 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
50 import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
51 import org.apache.maven.artifact.versioning.ArtifactVersion;
52 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
53 import org.apache.maven.artifact.versioning.VersionRange;
54 import org.apache.maven.execution.RuntimeInformation;
55 import org.apache.maven.model.Dependency;
56 import org.apache.maven.model.DependencyManagement;
57 import org.apache.maven.model.Exclusion;
58 import org.apache.maven.plugin.AbstractMojo;
59 import org.apache.maven.plugin.MojoExecutionException;
60 import org.apache.maven.plugin.MojoFailureException;
61 import org.apache.maven.plugin.eclipse.Constants;
62 import org.apache.maven.plugin.eclipse.Messages;
63 import org.apache.maven.project.MavenProject;
64 import org.codehaus.plexus.logging.LogEnabled;
65 import org.codehaus.plexus.logging.Logger;
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84 public abstract class AbstractIdeSupportMojo
85 extends AbstractMojo
86 implements LogEnabled
87 {
88
89
90
91
92
93
94
95
96 protected MavenProject project;
97
98
99
100
101
102
103
104 protected MavenProject executedProject;
105
106
107
108
109
110
111 protected String packaging;
112
113
114
115
116
117
118
119
120 protected ArtifactFactory artifactFactory;
121
122
123
124
125
126
127
128
129 protected ArtifactResolver artifactResolver;
130
131
132
133
134
135
136
137
138 protected ArtifactCollector artifactCollector;
139
140
141
142
143 protected ArtifactMetadataSource artifactMetadataSource;
144
145
146
147
148
149
150 private RuntimeInformation runtimeInformation;
151
152
153
154
155
156
157
158
159 protected List remoteArtifactRepositories;
160
161
162
163
164
165
166
167
168 protected ArtifactRepository localRepository;
169
170
171
172
173
174
175
176
177 protected List reactorProjects;
178
179
180
181
182
183
184 private boolean skip;
185
186
187
188
189
190
191
192
193
194
195 protected boolean downloadSources;
196
197
198
199
200
201
202
203
204
205
206 protected boolean downloadJavadocs;
207
208
209
210
211
212
213
214
215
216 protected boolean forceRecheck;
217
218
219
220
221 protected Logger logger;
222
223
224
225
226
227
228 public ArtifactMetadataSource getArtifactMetadataSource()
229 {
230 return artifactMetadataSource;
231 }
232
233
234
235
236
237
238 public void setArtifactMetadataSource( ArtifactMetadataSource artifactMetadataSource )
239 {
240 this.artifactMetadataSource = artifactMetadataSource;
241 }
242
243
244
245
246
247
248 public MavenProject getProject()
249 {
250 return project;
251 }
252
253
254
255
256
257
258 public void setProject( MavenProject project )
259 {
260 this.project = project;
261 }
262
263
264
265
266
267
268 public List getReactorProjects()
269 {
270 return reactorProjects;
271 }
272
273
274
275
276
277
278 public void setReactorProjects( List reactorProjects )
279 {
280 this.reactorProjects = reactorProjects;
281 }
282
283
284
285
286
287
288 public List getRemoteArtifactRepositories()
289 {
290 return remoteArtifactRepositories;
291 }
292
293
294
295
296
297
298 public void setRemoteArtifactRepositories( List remoteArtifactRepositories )
299 {
300 this.remoteArtifactRepositories = remoteArtifactRepositories;
301 }
302
303
304
305
306
307
308 public ArtifactFactory getArtifactFactory()
309 {
310 return artifactFactory;
311 }
312
313
314
315
316
317
318 public void setArtifactFactory( ArtifactFactory artifactFactory )
319 {
320 this.artifactFactory = artifactFactory;
321 }
322
323
324
325
326
327
328 public ArtifactResolver getArtifactResolver()
329 {
330 return artifactResolver;
331 }
332
333
334
335
336
337
338 public void setArtifactResolver( ArtifactResolver artifactResolver )
339 {
340 this.artifactResolver = artifactResolver;
341 }
342
343
344
345
346
347
348 public MavenProject getExecutedProject()
349 {
350 return executedProject;
351 }
352
353
354
355
356
357
358 public void setExecutedProject( MavenProject executedProject )
359 {
360 this.executedProject = executedProject;
361 }
362
363
364
365
366
367
368 public ArtifactRepository getLocalRepository()
369 {
370 return localRepository;
371 }
372
373
374
375
376
377
378 public void setLocalRepository( ArtifactRepository localRepository )
379 {
380 this.localRepository = localRepository;
381 }
382
383
384
385
386
387
388 public boolean getDownloadJavadocs()
389 {
390 return downloadJavadocs;
391 }
392
393
394
395
396
397
398 public void setDownloadJavadocs( boolean downloadJavadoc )
399 {
400 downloadJavadocs = downloadJavadoc;
401 }
402
403
404
405
406
407
408 public boolean getDownloadSources()
409 {
410 return downloadSources;
411 }
412
413
414
415
416
417
418 public void setDownloadSources( boolean downloadSources )
419 {
420 this.downloadSources = downloadSources;
421 }
422
423 protected void setResolveDependencies( boolean resolveDependencies )
424 {
425 this.resolveDependencies = resolveDependencies;
426 }
427
428 protected boolean isResolveDependencies()
429 {
430 return resolveDependencies;
431 }
432
433
434
435
436
437
438
439 protected abstract boolean getUseProjectReferences();
440
441
442
443
444
445
446
447 protected abstract boolean setup()
448 throws MojoExecutionException;
449
450
451
452
453
454
455
456 protected abstract void writeConfiguration( IdeDependency[] deps )
457 throws MojoExecutionException;
458
459
460
461
462 private List missingSourceDependencies = new ArrayList();
463
464
465
466
467
468 private List missingJavadocDependencies = new ArrayList();
469
470
471
472
473 private IdeDependency[] ideDeps;
474
475
476
477
478
479 private boolean resolveDependencies = true;
480
481
482
483
484 public void enableLogging( Logger logger )
485 {
486 this.logger = logger;
487 }
488
489
490
491
492 public final void execute()
493 throws MojoExecutionException, MojoFailureException
494 {
495 if ( skip )
496 {
497 return;
498 }
499
500 boolean processProject = setup();
501 if ( !processProject )
502 {
503 return;
504 }
505
506
507 IdeDependency[] deps = doDependencyResolution();
508
509 resolveSourceAndJavadocArtifacts( deps );
510
511 writeConfiguration( deps );
512
513 reportMissingArtifacts();
514
515 }
516
517
518
519
520
521
522
523
524
525 protected IdeDependency[] doDependencyResolution()
526 throws MojoExecutionException
527 {
528 if ( ideDeps == null )
529 {
530 if ( resolveDependencies )
531 {
532 MavenProject project = getProject();
533 ArtifactRepository localRepo = getLocalRepository();
534
535 List deps = getProject().getDependencies();
536
537
538 List dependencies = new ArrayList();
539
540 if ( deps != null )
541 {
542 Map managedVersions =
543 createManagedVersionMap( getArtifactFactory(), project.getId(),
544 project.getDependencyManagement() );
545
546 ArtifactResolutionResult artifactResolutionResult = null;
547
548 try
549 {
550
551 List listeners = new ArrayList();
552
553 if ( logger.isDebugEnabled() )
554 {
555 listeners.add( new DebugResolutionListener( logger ) );
556 }
557
558 listeners.add( new WarningResolutionListener( logger ) );
559
560 artifactResolutionResult =
561 artifactCollector.collect( getProjectArtifacts(), project.getArtifact(), managedVersions,
562 localRepo, project.getRemoteArtifactRepositories(),
563 getArtifactMetadataSource(), null, listeners );
564 }
565 catch ( ArtifactResolutionException e )
566 {
567 getLog().debug( e.getMessage(), e );
568 getLog().error(
569 Messages.getString( "AbstractIdeSupportMojo.artifactresolution", new Object[] {
570 e.getGroupId(), e.getArtifactId(), e.getVersion(),
571 e.getMessage() } ) );
572
573
574
575
576
577 return new IdeDependency[0];
578 }
579
580
581 Set emittedReactorProjectId = new HashSet();
582
583 for ( Iterator i = artifactResolutionResult.getArtifactResolutionNodes().iterator(); i.hasNext(); )
584 {
585
586 ResolutionNode node = (ResolutionNode) i.next();
587 int dependencyDepth = node.getDepth();
588 Artifact art = node.getArtifact();
589
590 if ( hasToResolveJar( art ) )
591 {
592 try
593 {
594 artifactResolver.resolve( art, node.getRemoteRepositories(), localRepository );
595 }
596 catch ( ArtifactNotFoundException e )
597 {
598 getLog().debug( e.getMessage(), e );
599 getLog().warn(
600 Messages.getString(
601 "AbstractIdeSupportMojo.artifactdownload", new Object[] {
602 e.getGroupId(), e.getArtifactId(), e.getVersion(),
603 e.getMessage() } ) );
604 }
605 catch ( ArtifactResolutionException e )
606 {
607 getLog().debug( e.getMessage(), e );
608 getLog().warn(
609 Messages.getString(
610 "AbstractIdeSupportMojo.artifactresolution", new Object[] {
611 e.getGroupId(), e.getArtifactId(), e.getVersion(),
612 e.getMessage() } ) );
613 }
614 }
615
616 boolean includeArtifact = true;
617 if ( getExcludes() != null )
618 {
619 String artifactFullId = art.getGroupId() + ":" + art.getArtifactId();
620 if ( getExcludes().contains( artifactFullId ) )
621 {
622 getLog().info( "excluded: " + artifactFullId );
623 includeArtifact = false;
624 }
625 }
626
627 if ( includeArtifact
628 && ( !( getUseProjectReferences() && isAvailableAsAReactorProject( art ) ) || emittedReactorProjectId.add( art.getGroupId()
629 + '-' + art.getArtifactId() ) ) )
630 {
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645 boolean isOsgiBundle = false;
646 String osgiSymbolicName = null;
647 if ( art.getFile() != null )
648 {
649 JarFile jarFile = null;
650 try
651 {
652 jarFile = new JarFile( art.getFile(), false, ZipFile.OPEN_READ );
653
654 Manifest manifest = jarFile.getManifest();
655 if ( manifest != null )
656 {
657 osgiSymbolicName =
658 manifest.getMainAttributes().getValue(
659 new Attributes.Name(
660 "Bundle-SymbolicName" ) );
661 }
662 }
663 catch ( IOException e )
664 {
665 getLog().info( "Unable to read jar manifest from " + art.getFile() );
666 }
667 finally
668 {
669 if ( jarFile != null )
670 {
671 try
672 {
673 jarFile.close();
674 }
675 catch ( IOException e )
676 {
677
678 }
679 }
680 }
681 }
682
683 isOsgiBundle = osgiSymbolicName != null;
684
685 IdeDependency dep =
686 new IdeDependency( art.getGroupId(), art.getArtifactId(), art.getVersion(),
687 art.getClassifier(), useProjectReference( art ),
688 Artifact.SCOPE_TEST.equals( art.getScope() ),
689 Artifact.SCOPE_SYSTEM.equals( art.getScope() ),
690 Artifact.SCOPE_PROVIDED.equals( art.getScope() ),
691 art.getArtifactHandler().isAddedToClasspath(), art.getFile(),
692 art.getType(), isOsgiBundle, osgiSymbolicName, dependencyDepth,
693 getProjectNameForArifact( art ) );
694
695 if ( !dependencies.contains( dep ) )
696 {
697 dependencies.add( dep );
698 }
699 }
700
701 }
702
703
704
705
706 }
707
708 ideDeps = (IdeDependency[]) dependencies.toArray( new IdeDependency[dependencies.size()] );
709 }
710 else
711 {
712 ideDeps = new IdeDependency[0];
713 }
714 }
715
716 return ideDeps;
717 }
718
719
720
721
722
723
724
725 abstract public String getProjectNameForArifact( Artifact artifact );
726
727
728
729
730
731
732
733
734 private Set getProjectArtifacts()
735 throws MojoExecutionException
736 {
737
738 Set artifacts = new TreeSet();
739
740 for ( Iterator dependencies = getProject().getDependencies().iterator(); dependencies.hasNext(); )
741 {
742 Dependency dependency = (Dependency) dependencies.next();
743
744 String groupId = dependency.getGroupId();
745 String artifactId = dependency.getArtifactId();
746 VersionRange versionRange;
747 try
748 {
749 versionRange = VersionRange.createFromVersionSpec( dependency.getVersion() );
750 }
751 catch ( InvalidVersionSpecificationException e )
752 {
753 throw new MojoExecutionException(
754 Messages.getString(
755 "AbstractIdeSupportMojo.unabletoparseversion", new Object[] {
756 dependency.getArtifactId(),
757 dependency.getVersion(),
758 dependency.getManagementKey(), e.getMessage() } ),
759 e );
760 }
761
762 String type = dependency.getType();
763 if ( type == null )
764 {
765 type = Constants.PROJECT_PACKAGING_JAR;
766 }
767 String classifier = dependency.getClassifier();
768 boolean optional = dependency.isOptional();
769 String scope = dependency.getScope();
770 if ( scope == null )
771 {
772 scope = Artifact.SCOPE_COMPILE;
773 }
774
775 Artifact art =
776 getArtifactFactory().createDependencyArtifact( groupId, artifactId, versionRange, type, classifier,
777 scope, optional );
778
779 if ( scope.equalsIgnoreCase( Artifact.SCOPE_SYSTEM ) )
780 {
781 art.setFile( new File( dependency.getSystemPath() ) );
782 }
783
784 handleExclusions( art, dependency );
785
786 artifacts.add( art );
787 }
788
789 return artifacts;
790 }
791
792
793
794
795
796
797
798 private void handleExclusions( Artifact artifact, Dependency dependency )
799 {
800
801 List exclusions = new ArrayList();
802 for ( Iterator j = dependency.getExclusions().iterator(); j.hasNext(); )
803 {
804 Exclusion e = (Exclusion) j.next();
805 exclusions.add( e.getGroupId() + ":" + e.getArtifactId() );
806 }
807
808 ArtifactFilter newFilter = new ExcludesArtifactFilter( exclusions );
809
810 artifact.setDependencyFilter( newFilter );
811 }
812
813
814
815
816
817
818
819 protected boolean isAvailableAsAReactorProject( Artifact artifact )
820 {
821 return getReactorProject( artifact ) != null;
822 }
823
824
825
826
827
828
829
830 protected MavenProject getReactorProject( Artifact artifact )
831 {
832 if ( reactorProjects != null )
833 {
834 for ( Iterator iter = reactorProjects.iterator(); iter.hasNext(); )
835 {
836 MavenProject reactorProject = (MavenProject) iter.next();
837
838 if ( reactorProject.getGroupId().equals( artifact.getGroupId() )
839 && reactorProject.getArtifactId().equals( artifact.getArtifactId() ) )
840 {
841 if ( reactorProject.getVersion().equals( artifact.getVersion() ) )
842 {
843 return reactorProject;
844 }
845 else
846 {
847 getLog().info(
848 "Artifact "
849 + artifact.getId()
850 + " already available as a reactor project, but with different version. Expected: "
851 + artifact.getVersion() + ", found: " + reactorProject.getVersion() );
852 }
853 }
854 }
855 }
856 return null;
857 }
858
859
860
861
862 protected IdeDependency[] getWorkspaceArtefacts()
863 {
864 return new IdeDependency[0];
865 }
866
867 private Map createManagedVersionMap( ArtifactFactory artifactFactory, String projectId,
868 DependencyManagement dependencyManagement )
869 throws MojoExecutionException
870 {
871 Map map;
872 if ( dependencyManagement != null && dependencyManagement.getDependencies() != null )
873 {
874 map = new HashMap();
875 for ( Iterator i = dependencyManagement.getDependencies().iterator(); i.hasNext(); )
876 {
877 Dependency d = (Dependency) i.next();
878
879 try
880 {
881 VersionRange versionRange = VersionRange.createFromVersionSpec( d.getVersion() );
882 Artifact artifact =
883 artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange,
884 d.getType(), d.getClassifier(), d.getScope(),
885 d.isOptional() );
886
887 handleExclusions( artifact, d );
888 map.put( d.getManagementKey(), artifact );
889 }
890 catch ( InvalidVersionSpecificationException e )
891 {
892 throw new MojoExecutionException(
893 Messages.getString(
894 "AbstractIdeSupportMojo.unabletoparseversion", new Object[] {
895 projectId, d.getVersion(),
896 d.getManagementKey(), e.getMessage() } ),
897 e );
898 }
899 }
900 }
901 else
902 {
903 map = Collections.EMPTY_MAP;
904 }
905 return map;
906 }
907
908
909
910
911
912
913
914
915
916 private void resolveSourceAndJavadocArtifacts( IdeDependency[] deps )
917 {
918 final List missingSources = resolveDependenciesWithClassifier( deps, "sources", getDownloadSources() );
919 missingSourceDependencies.addAll( missingSources );
920
921 final List missingJavadocs = resolveDependenciesWithClassifier( deps, "javadoc", getDownloadJavadocs() );
922 missingJavadocDependencies.addAll( missingJavadocs );
923 }
924
925
926
927
928
929
930
931
932
933
934 private List resolveDependenciesWithClassifier( IdeDependency[] deps, String inClassifier,
935 boolean includeRemoteRepositories )
936 {
937 List missingClassifierDependencies = new ArrayList();
938
939
940
941 List remoteRepos = includeRemoteRepositories ? getRemoteArtifactRepositories() : Collections.EMPTY_LIST;
942
943 for ( int j = 0; j < deps.length; j++ )
944 {
945 IdeDependency dependency = deps[j];
946
947 if ( dependency.isReferencedProject() || dependency.isSystemScoped() )
948 {
949
950 continue;
951 }
952
953 if ( getLog().isDebugEnabled() )
954 {
955 getLog().debug(
956 "Searching for sources for " + dependency.getId() + ":" + dependency.getClassifier()
957 + " at " + dependency.getId() + ":" + inClassifier );
958 }
959
960 Artifact baseArtifact =
961 artifactFactory.createArtifactWithClassifier( dependency.getGroupId(), dependency.getArtifactId(),
962 dependency.getVersion(), dependency.getType(),
963 dependency.getClassifier() );
964 baseArtifact =
965 IdeUtils.resolveArtifact( artifactResolver, baseArtifact, remoteRepos, localRepository, getLog() );
966 if ( !baseArtifact.isResolved() )
967 {
968
969 continue;
970 }
971
972 Artifact artifact =
973 IdeUtils.createArtifactWithClassifier( dependency.getGroupId(), dependency.getArtifactId(),
974 dependency.getVersion(), dependency.getClassifier(),
975 inClassifier, artifactFactory );
976 File notAvailableMarkerFile = IdeUtils.getNotAvailableMarkerFile( localRepository, artifact );
977
978 if ( forceRecheck && notAvailableMarkerFile.exists() )
979 {
980 if ( !notAvailableMarkerFile.delete() )
981 {
982 getLog().warn(
983 Messages.getString( "AbstractIdeSupportMojo.unabletodeletenotavailablemarkerfile",
984 notAvailableMarkerFile ) );
985 }
986 }
987
988 if ( !notAvailableMarkerFile.exists() )
989 {
990 artifact =
991 IdeUtils.resolveArtifact( artifactResolver, artifact, remoteRepos, localRepository, getLog() );
992 if ( artifact.isResolved() )
993 {
994 if ( "sources".equals( inClassifier ) )
995 {
996 dependency.setSourceAttachment( artifact.getFile() );
997 }
998 else if ( "javadoc".equals( inClassifier ) )
999 {
1000 dependency.setJavadocAttachment( artifact.getFile() );
1001 }
1002 }
1003 else
1004 {
1005 if ( includeRemoteRepositories )
1006 {
1007 try
1008 {
1009 notAvailableMarkerFile.createNewFile();
1010 getLog().debug(
1011 Messages.getString( "AbstractIdeSupportMojo.creatednotavailablemarkerfile",
1012 notAvailableMarkerFile ) );
1013 }
1014 catch ( IOException e )
1015 {
1016 getLog().warn(
1017 Messages.getString(
1018 "AbstractIdeSupportMojo.failedtocreatenotavailablemarkerfile",
1019 notAvailableMarkerFile ) );
1020 }
1021 }
1022
1023
1024
1025 missingClassifierDependencies.add( dependency );
1026 }
1027 }
1028 }
1029
1030
1031
1032 return missingClassifierDependencies;
1033
1034 }
1035
1036
1037
1038
1039 private void reportMissingArtifacts()
1040 {
1041 StringBuffer msg = new StringBuffer();
1042
1043 if ( !missingSourceDependencies.isEmpty() )
1044 {
1045 if ( getDownloadSources() )
1046 {
1047 msg.append( Messages.getString( "AbstractIdeSupportMojo.sourcesnotavailable" ) );
1048 }
1049 else
1050 {
1051 msg.append( Messages.getString( "AbstractIdeSupportMojo.sourcesnotdownloaded" ) );
1052 }
1053
1054 for ( Iterator it = missingSourceDependencies.iterator(); it.hasNext(); )
1055 {
1056 IdeDependency art = (IdeDependency) it.next();
1057 msg.append( Messages.getString( "AbstractIdeSupportMojo.sourcesmissingitem", art.getId() ) );
1058 }
1059 msg.append( "\n" );
1060 }
1061
1062 if ( !missingJavadocDependencies.isEmpty() )
1063 {
1064 if ( getDownloadJavadocs() )
1065 {
1066 msg.append( Messages.getString( "AbstractIdeSupportMojo.javadocnotavailable" ) );
1067 }
1068 else
1069 {
1070 msg.append( Messages.getString( "AbstractIdeSupportMojo.javadocnotdownloaded" ) );
1071 }
1072
1073 for ( Iterator it = missingJavadocDependencies.iterator(); it.hasNext(); )
1074 {
1075 IdeDependency art = (IdeDependency) it.next();
1076 msg.append( Messages.getString( "AbstractIdeSupportMojo.javadocmissingitem", art.getId() ) );
1077 }
1078 msg.append( "\n" );
1079 }
1080 getLog().info( msg );
1081 }
1082
1083
1084
1085
1086
1087 public abstract List getExcludes();
1088
1089
1090
1091
1092
1093
1094
1095 protected boolean hasToResolveJar( Artifact art )
1096 {
1097 return !( getUseProjectReferences() && isAvailableAsAReactorProject( art ) );
1098 }
1099
1100
1101
1102
1103
1104
1105
1106 protected boolean useProjectReference( Artifact art )
1107 {
1108 return getUseProjectReferences() && isAvailableAsAReactorProject( art );
1109 }
1110
1111
1112
1113
1114
1115
1116
1117
1118 protected boolean isMavenVersion( String version )
1119 {
1120 try
1121 {
1122 VersionRange versionRange = VersionRange.createFromVersionSpec( version );
1123 ArtifactVersion mavenVersion = runtimeInformation.getApplicationVersion();
1124 return versionRange.containsVersion( mavenVersion );
1125 }
1126 catch ( InvalidVersionSpecificationException e )
1127 {
1128 throw new IllegalArgumentException( e.getMessage() );
1129 }
1130 }
1131
1132 }