-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sergey Morgunov
committed
Aug 18, 2019
1 parent
ea61d67
commit 3de958f
Showing
42 changed files
with
653 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions
42
...enArchetype.truthy)$maven$endif$/$if(mavenArchetype.truthy)$archetype-metadata.xml$endif$
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" | ||
name="lagom-maven-java"> | ||
|
||
<requiredProperties> | ||
<requiredProperty key="serviceName"> | ||
<defaultValue>hello</defaultValue> | ||
</requiredProperty> | ||
<requiredProperty key="serviceClassName"> | ||
<defaultValue>Hello</defaultValue> | ||
</requiredProperty> | ||
<!-- These properties must be valid Velocity identifiers, so cannot contain dots. --> | ||
<requiredProperty key="scala-binary-version"> | ||
<defaultValue>2.12</defaultValue> | ||
<validationRegex>\d+\.\d+</validationRegex> | ||
</requiredProperty> | ||
</requiredProperties> | ||
|
||
<!-- If you read up on the documentation and various blog posts and question/answers out on the internet, you'll | ||
see that the archetype descriptor actually has a nifty feature where it can be aware of different modules, and | ||
name packages for you, and all sorts of wonderful things. The problem is, we want the names of the modules to be | ||
dynamically selected using the above properties (eg, service1Name), but the Maven archetype plugin treats module | ||
directories different to all other directories, where other directories can substitute any property they want | ||
using __myPropertyName__ syntax, the module directory is hard coded to only substitute __rootArtifactId__. This | ||
issue has been raised here: https://issues.apache.org/jira/browse/ARCHETYPE-455, a patch has existed for 3 years, | ||
but no response or review from the maintainers. So, consequently, we can't use modules in the archetype | ||
descriptor. --> | ||
|
||
<fileSets> | ||
<fileSet filtered="true" encoding="UTF-8"> | ||
<directory></directory> | ||
<includes> | ||
<include>**/*</include> | ||
</includes> | ||
<excludes> | ||
<exclude>pom.xml</exclude> | ||
<exclude>LICENSE</exclude> | ||
</excludes> | ||
</fileSet> | ||
</fileSets> | ||
|
||
</archetype-descriptor> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/java/$package$/api/GreetingMessage.java → ...iceName__$endif$/api/GreetingMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...impl/$if(mavenArchetype.truthy)$__serviceClassName__$else$$name__Camel$$endif$Module.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package $if(mavenArchetype.truthy)$\${package}.\${serviceName}$else$$package$$endif$.impl; | ||
|
||
import com.google.inject.AbstractModule; | ||
import com.lightbend.lagom.javadsl.server.ServiceGuiceSupport; | ||
|
||
import $if(mavenArchetype.truthy)$\${package}.\${serviceName}$else$$package$$endif$.api.$if(mavenArchetype.truthy)$\${serviceClassName}$else$$name;format="Camel"$$endif$Service; | ||
|
||
/** | ||
* The module that binds the $if(mavenArchetype.truthy)$\${serviceClassName}$else$$name;format="Camel"$$endif$Service so that it can be served. | ||
*/ | ||
public class $if(mavenArchetype.truthy)$\${serviceClassName}$else$$name;format="Camel"$$endif$Module extends AbstractModule implements ServiceGuiceSupport { | ||
@Override | ||
protected void configure() { | ||
bindService($if(mavenArchetype.truthy)$\${serviceClassName}$else$$name;format="Camel"$$endif$Service.class, $if(mavenArchetype.truthy)$\${serviceClassName}$else$$name;format="Camel"$$endif$ServiceImpl.class); | ||
} | ||
} |
Oops, something went wrong.