Now that you've got Maven installed you can get started with your project. Run the following command in the directory where you want your code to be stored:
mvn archetype:generate -DarchetypeGroupId=org.aion4j -DarchetypeArtifactId=avm-archetype -DarchetypeVersion=0.20
You can find the latest archetype version on Github.
Archetype Version Screenshot
The archetype generator will ask you for a
package. You can put whatever you want in these fields, but it will help you further down the line if you follow these guidelines.
||Uniquely identifies your project across all projects. Must follow Apache's reverse domain naming control convention.||
||The name of the
||Which version of the project you're building. You can choose any typical version with numbers and dots.||
||Apache is very specific about what to use here. However for the purposes of this HelloWorld project, the package name doesn't really matter.||
Here's an example:
Confirm properties configuration: groupId: com.helloworld artifactId: hello-world version: 1.0-SNAPSHOT package: com.helloworld
Once you've run the archetype command and filled in the fields, you will have a file structure similar to this:
hello-world/ ├── pom.xml └── src ├── main │ └── java │ └── com │ └── helloworld │ └── HelloAvm.java └── test └── java └── com └── helloworld └── HelloAvmRuleTest.java
In the latest version of the Maven Aion4J plugin, you don't have to do any further configuration to the
pom.xml file after creating the project. If you are using archetype version
0.10 or higher, you don't need to follow this section. Head straight to Initialize.
However, if you are using archetype version
0.9 or lower, then there's still a little bit of configuration left to do before you can deploy your contract. You need to change the Aion4j version number selected in the
- Open the
pom.xmlfile in a text editor.
- Find the line that beings with
aion4j.plugin.versionand change the value to the latest release listed on the Github page:
Github Package Version
<properties> ... <aion4j.plugin.version>0.5.1</aion4j.plugin.version> ... </properties>
pom.xml file has been configured, you can launch the Aion4j maven initializer to pull the avm
libs and finalize the folder structure of your project.
mvn initialize > [INFO] Scanning for projects... ... [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.476 s ...
That's it! Your project has been initialized and everything ready for you to start developing your application.