-
Notifications
You must be signed in to change notification settings - Fork 57
Setting Up a New Maven Project
Maven Archetypes are the most convenient way of creating your own (Maven) projects that use LearnLib. On this page, we will explain how you set up your own project using the Maven via the command-line.
We assume that you have a sufficiently recent version of Maven 3 installed, and that you are familiar with a command-line shell (such as bash).
To create a new Maven project from a LearnLib archetype, simply enter the following command in your shell:
mvn archetype:generate -Dfilter=de.learnlib: This will list the available archetypes matching the de.learnlib groupId. Continue with selecting the kind of archetype and the version of archetype you want to use. Upon selecting a specific archetype, you will be prompted for the following information:
- Value for
groupId: This serves as the group identifier of your Maven project, it should be in a form similar to Java packages, such asorg.example.learnlib - Value for
artifactId: This serves as the group-local identifier of your Maven project. It should be in a very simple, all-lowercase form, such asmy-project. - Value for
version: The (initial) version of your project. The default is1.0-SNAPSHOT. - Value for
package: The name of your root package. The default is thegroupIdyou entered before.
Your command prompt might then look similar to the following:
[INFO] Using property: learnlibVersion = 0.18.0
Define value for property 'groupId': org.example.learnlib
Define value for property 'artifactId': my-project
Define value for property 'version' 1.0-SNAPSHOT:
Define value for property 'package' org.example.learnlib:
Confirm properties configuration:
learnlibVersion: 0.18.0
groupId: org.example.learnlib
artifactId: my-project
version: 1.0-SNAPSHOT
package: org.example.learnlib
Y: You will notice the INFO message about the property learnlibVersion. This controls which version of LearnLib will be used for your project. If you want to change this version (which is not recommended, as the archetypes are only guaranteed to work properly with the respective version of LearnLib they are shipped with), enter N now. You will have to re-enter the information, but in addition will be given the opportunity to also specify the learnlibVersion property. If the displayed settings finally are correct, just hit enter in the Y: : prompt.
[INFO] Using property: learnlibVersion = 0.18.0
Define value for property 'groupId': org.example.learnlib
Define value for property 'artifactId': my-project
Define value for property 'version' 1.0-SNAPSHOT:
Define value for property 'package' org.example.learnlib:
Confirm properties configuration:
learnlibVersion: 0.18.0
groupId: org.example.learnlib
artifactId: my-project
version: 1.0-SNAPSHOT
package: org.example.learnlib
Y:
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: complete:0.18.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.example.learnlib
[INFO] Parameter: artifactId, Value: my-project
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: org.example.learnlib
[INFO] Parameter: packageInPathFormat, Value: org/example/learnlib
[INFO] Parameter: learnlibVersion, Value: 0.18.0
[INFO] Parameter: package, Value: org.example.learnlib
[INFO] Parameter: groupId, Value: org.example.learnlib
[INFO] Parameter: artifactId, Value: my-project
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Project created from Archetype in dir: /path/to/my-projectThe directory specified in the last line (which is the subdirectory named as the artifactId of the current working directory) will then contain your new Maven project.