36
36
import org .w3c .dom .Document ;
37
37
import org .w3c .dom .Node ;
38
38
import software .amazon .awssdk .utils .Logger ;
39
- import software .amazon .awssdk .utils .Validate ;
40
39
41
40
/**
42
41
* A command line application to create a new, empty service.
@@ -96,11 +95,11 @@ private static class NewServiceCreator {
96
95
private final String serviceProtocol ;
97
96
98
97
private NewServiceCreator (CommandLine commandLine ) {
99
- this .mavenProjectRoot = Paths .get (commandLine .getOptionValue ("maven-project-root" ));
100
- this .mavenProjectVersion = commandLine .getOptionValue ("maven-project-version" );
101
- this .serviceModuleName = commandLine .getOptionValue ("service-module-name" );
102
- this .serviceId = commandLine .getOptionValue ("service-id" );
103
- this .serviceProtocol = transformSpecialProtocols (commandLine .getOptionValue ("service-protocol" ));
98
+ this .mavenProjectRoot = Paths .get (commandLine .getOptionValue ("maven-project-root" ). trim () );
99
+ this .mavenProjectVersion = commandLine .getOptionValue ("maven-project-version" ). trim () ;
100
+ this .serviceModuleName = commandLine .getOptionValue ("service-module-name" ). trim () ;
101
+ this .serviceId = commandLine .getOptionValue ("service-id" ). trim () ;
102
+ this .serviceProtocol = transformSpecialProtocols (commandLine .getOptionValue ("service-protocol" ). trim () );
104
103
}
105
104
106
105
private String transformSpecialProtocols (String protocol ) {
@@ -113,8 +112,6 @@ private String transformSpecialProtocols(String protocol) {
113
112
}
114
113
115
114
public void run () throws Exception {
116
- Validate .isTrue (Files .exists (mavenProjectRoot ), "Project root does not exist: " + mavenProjectRoot );
117
-
118
115
Path servicesRoot = mavenProjectRoot .resolve ("services" );
119
116
Path templateModulePath = servicesRoot .resolve ("new-service-template" );
120
117
Path newServiceModulePath = servicesRoot .resolve (serviceModuleName );
0 commit comments