diff options
4 files changed, 22 insertions, 0 deletions
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml index a91c20c80b..9bbaa237dd 100644 --- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml +++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml @@ -97,6 +97,10 @@ <downloadSources>true</downloadSources>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ </plugin>
</plugins>
</build>
<properties>
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java index 2491816adc..af90e4fe7f 100644 --- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java +++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java @@ -18,10 +18,19 @@ */
package ${package};
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.EagerInit;
+
+@Scope("COMPOSITE") @EagerInit
public class HelloworldImpl implements HelloworldService {
public String sayHello(String name) {
return "Hello " + name;
}
+ @Init
+ public void init() {
+ System.out.println(sayHello("world"));
+ }
}
diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml index 026dda5f3c..20cb1fe810 100644 --- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml +++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml @@ -109,6 +109,10 @@ <artifactId>maven-zip-plugin</artifactId> <extensions>true</extensions> </plugin> + <plugin> + <groupId>org.apache.tuscany.maven.plugins</groupId> + <artifactId>maven-tuscany-plugin</artifactId> + </plugin> </plugins> </build> <properties> diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java index 86073fc14d..26237c105c 100644 --- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java +++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java @@ -18,6 +18,7 @@ */ package ${package}; +import org.oasisopen.sca.annotation.Init; import org.oasisopen.sca.annotation.Scope; import org.oasisopen.sca.annotation.EagerInit; @@ -28,4 +29,8 @@ public class HelloworldImpl implements HelloworldService { return "Hello " + name; } + @Init + public void init() { + System.out.println(sayHello("world")); + } } |