Skip to content

Commit 7dbd2f4

Browse files
committed
Add a javadoc description for RunFunction.
Also add the pom.xml incantation to make this text appear when the user does mvn function:help. PiperOrigin-RevId: 294347457
1 parent 97025cb commit 7dbd2f4

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

invoker/function-maven-plugin/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@
6262
<groupId>org.apache.maven.plugins</groupId>
6363
<artifactId>maven-plugin-plugin</artifactId>
6464
<version>3.6.0</version>
65+
<executions>
66+
<execution>
67+
<id>help-goal</id>
68+
<goals>
69+
<goal>helpmojo</goal>
70+
</goals>
71+
</execution>
72+
</executions>
6573
</plugin>
6674
</plugins>
6775
</build>

invoker/function-maven-plugin/src/main/java/com/google/cloud/functions/plugin/RunFunction.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,30 @@
1313
import org.apache.maven.plugins.annotations.Parameter;
1414
import org.apache.maven.plugins.annotations.ResolutionScope;
1515

16+
/**
17+
* Runs a function using the Java Functions Framework. Typically this plugin is configured in one
18+
* of two ways. Either in the pom.xml file, like this...
19+
*
20+
* <pre>{@code
21+
* <plugin>
22+
* <groupId>com.google.cloud.functions</groupId>
23+
* <artifactId>function-maven-plugin</artifactId>
24+
* <version>1.0.0-alpha-2-rc3</version>
25+
* <configuration>
26+
* <functionTarget>com.example.function.Echo</functionTarget>
27+
* </configuration>
28+
* </plugin>
29+
* }</pre>
30+
*
31+
* ...and then run using {@code mvn function:run}. Or using properties on the command line, like
32+
* this...<br>
33+
*
34+
* <pre>{@code
35+
* mvn com.google.cloud.functions:function:1.0.0-alpha-2-rc3:run \
36+
* -Drun.functionTarget=com.example.function.Echo}
37+
* </pre>
38+
*
39+
*/
1640
@Mojo(name = "run",
1741
defaultPhase = LifecyclePhase.GENERATE_RESOURCES,
1842
requiresDependencyResolution = ResolutionScope.COMPILE,

0 commit comments

Comments
 (0)