1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 package org.codehaus.mojo.jaxws;
38
39 import java.io.File;
40 import java.util.List;
41 import java.util.stream.Collectors;
42
43 import org.apache.maven.artifact.Artifact;
44 import org.apache.maven.plugins.annotations.LifecyclePhase;
45 import org.apache.maven.plugins.annotations.Mojo;
46 import org.apache.maven.plugins.annotations.Parameter;
47 import org.apache.maven.plugins.annotations.ResolutionScope;
48
49
50
51
52
53
54 @Mojo( name = "wsimport", defaultPhase = LifecyclePhase.GENERATE_SOURCES,
55 requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true )
56 public class MainWsImportMojo
57 extends WsImportMojo
58 {
59
60
61
62
63
64 @Parameter( defaultValue = "${project.build.outputDirectory}" )
65 private File destDir;
66
67
68
69
70 @Parameter( defaultValue = "${project.build.directory}/generated-sources/wsimport" )
71 private File sourceDestDir;
72
73
74
75
76 @Parameter( defaultValue = "${project.build.sourceDirectory}" )
77 private File implDestDir;
78
79
80
81
82 @Override
83 protected File getDestDir()
84 {
85 return destDir;
86 }
87
88 @Override
89 protected File getSourceDestDir()
90 {
91 return sourceDestDir;
92 }
93
94 @Override
95 protected File getDefaultSrcOut()
96 {
97 return new File( project.getBuild().getDirectory(), "generated-sources/wsimport" );
98 }
99
100 @Override
101 protected File getImplDestDir()
102 {
103 return implDestDir;
104 }
105
106 @Override
107 protected List<String> getWSDLFileLookupClasspathElements()
108 {
109 return project.getDependencyArtifacts().stream()
110 .filter( a -> (Artifact.SCOPE_COMPILE.equals( a.getScope() )
111 || Artifact.SCOPE_PROVIDED.equals( a.getScope() )
112 || Artifact.SCOPE_SYSTEM.equals( a.getScope()) )
113 && null != a.getFile() )
114 .map( a -> a.getFile().getPath() ).collect( Collectors.toList() );
115 }
116 }