3939 */
4040@ Mojo (name = "run" ,
4141 defaultPhase = LifecyclePhase .GENERATE_RESOURCES ,
42- requiresDependencyResolution = ResolutionScope .COMPILE ,
43- requiresDependencyCollection = ResolutionScope .COMPILE )
42+ requiresDependencyResolution = ResolutionScope .RUNTIME ,
43+ requiresDependencyCollection = ResolutionScope .RUNTIME )
4444@ Execute (phase = LifecyclePhase .COMPILE )
4545public class RunFunction extends AbstractMojo {
4646
47+
4748 /**
4849 * The name of the function to run. This is the name of a class that implements one of the
4950 * interfaces in {@code com.google.cloud.functions}.
@@ -61,11 +62,11 @@ public class RunFunction extends AbstractMojo {
6162 * Used to determine what classpath needs to be used to load the function. This parameter is
6263 * injected by Maven and can't be set explicitly in a pom.xml file.
6364 */
64- @ Parameter (defaultValue = "${project.compileClasspathElements }" , readonly = true , required = true )
65- private List <String > compilePath ;
65+ @ Parameter (defaultValue = "${project.runtimeClasspathElements }" , readonly = true , required = true )
66+ private List <String > runtimePath ;
6667
6768 public void execute () throws MojoExecutionException {
68- String classpath = String .join (File .pathSeparator , compilePath );
69+ String classpath = String .join (File .pathSeparator , runtimePath );
6970 List <String > args = new ArrayList <>();
7071 args .addAll (Arrays .asList ("--classpath" , classpath ));
7172 if (functionTarget != null ) {
0 commit comments