zerocode custom-archetype
See original GitHub issueGIVEN the archetype/resources are available WHEN I run the following/similar maven command
mvn archetype:generate -DarchetypeGroupId=<custom-archetype group id e.g.>
-DarchetypeArtifactId=<custom-archetype artifactid>
-DarchetypeVersion=<custom-archetype version>
-DgroupId=<new project Group Id>
-DartifactId=<new project artifact Id>
THEN I will generate the Zerocode maven project with an example test scenario.
Description
The output of the above command will produce //TODO - structure of the project with a list of Java and resources files. //TODO - attach a sample maven project which is expected as output(.zip file)
- src/main/java
- com.myproject
- utils
- MyUtils.java
- src/test/java
- com.myproject
- tests
- MyGetApiTest.java
- MyPostApiTest.java
- MyPutApiTest.java
- MyApiSuite.java <----- To run the entire test suite
- src/test/resources
- tests
- get_api_200.json
- post_api_200.json
- put_api_200.json
- hostconfig_ci.properties
- hostconfig_sit.properties
Implementation Help
-
Step by step approach - https://dzone.com/articles/creating-a-custom-maven-archetype
-
Running examples - https://www.baeldung.com/maven-archetype
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Archetype Object Model 2 (AOM2) - openEHR Specifications
Introduction of 'tuple' constraints to replace openEHR custom constrainer types for covarying attributes within Quantity, Ordinal structures;.
Read more >Maven Configuration Issue error | Selenium Forum
The application contains a custom GWT widgetset that is compiled ... 2284: remote -> org.jsmart:zerocode-maven-archetype (Zerocode ...
Read more >Autify, Provider of AI-Powered, Zero-Code ... - AiThority.com
Allows Javascript input for advanced or custom use scenarios; Can be linked to external services including Slack, Circle CI and TestRail. Read ...
Read more >Download zerocode-maven-archetype JAR file with all dependencies
Download zerocode-maven-archetype JAR file ✓ With dependencies ✓ Documentation ✓ Source code.
Read more >Maven Archetype Plugin – archetype:integration-test
Description: Execute the archetype integration tests, consisting in generating projects from the current archetype and optionally comparing ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @authorjapps I’d like to contribute. Is it ok to submit a pull request if it’s assigned already?
@waqassiddiqi - Great to have you helping!
In addition to the links @authorjapps posted earlier, below are some helpful extra bits if required:
In the
archetype-metadata.xml
file, if you set “filtered” to true for a file/folder structure then the engine will parse any token starting with a$
, if you want to create the archetype with $ symbols which I suspect you will due to the token utilities containing a $ (i.e. ${SYSTEM.PROP:username} then you can do the following:Here I have set a variable named
$MONGO_CONNECTION_URI
and given it the value${MONGO_CONNECTION_URI}
, this means that when I reference the variable$MONGO_CONNECTION_URI
anywhere in the code it will be interpreted and replaced by the value${MONGO_CONNECTION_URI}
in the generated project. Without this approach, the engine would try to parse${MONGO_CONNECTION_URI}
as a variable which wouldn’t work as I have no variables in the project with that name -> Admittedly this isn’t the clearest concept to grasp so do reach out if you have any questions.If you want to name the files using one of the maven archetype properties you can encase the file with
__propertyName__
, two underscores before and after the property name, in my example below I created a custom property calledentityName
and I used the value of that to give the file names meaning: When the project is generated, the property name is interpreted and transformed to become "ItemApplication.java` if the entityName property was set to Item.Finally, you can use IF statements inside the maven archetype, in the example below I have another custom property called
includeGetById
, I check if the value is equal to true and then if it is, I include a line of Java code, this means that if the condition fails, the generated code would not include this line, if the condition equated to true then the line would appear in the generated code, this is useful for complex scenarios.If you need anything else please reach out, good luck!