-
Notifications
You must be signed in to change notification settings - Fork 12
Maven
We use maven 3.6.
You need to install maven in your computer.
Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. It provides a way to help with managing:
- Builds
- Documentation
- Reporting
- Dependencies
- SCMs
- Releases
- Distribution
- https://mvnrepository.com/ indexes the Maven repositories, providing developers with a fast and easy way to search for packages and their dependencies.
- https://maven.apache.org/
- https://maven.apache.org/guides/getting-started/index.html
In Wegas, the main project (= module) is wegas-project. It contains multiple modules : build-tools, wegas-core, wegas-ts-api, wegas-app, wegas-resources, wenerator-maven-plugin, wegas-runtime, wegas-annotation (the sorting is important to handle the dependencies). This structure allow to build everything with one call at wegas-project level.
All projects have a clear folder structure used by maven.
Each module has a pom.xml file to configure maven.
Some modules have a src/site/site.xml file to configure the reporting.
-
mvn install -DskipTeststo compile and build but without launching all tests -
mvn install -DskipPrivateTeststo compile and build but without launching the tests that have aPrivateRelatedTestannotation -
mvn installto compile, build and launch the tests -
mvn clean installto clean thetargetfolder, compile, build and launch the tests
-
mvn testto run the tests -
mvn test -pl wegas-core -Dtest=xxxTestto run a specific test
see maven documentation.
The dependencies are locally stored in a .m2 folder at root.
The dependency management section is a mechanism for centralizing dependency information. When you have a set of projects that inherit from a common parent, it's possible to put all information about the dependency in the common POM and have simpler references to the artifacts in the child POMs. wegas-project pom.xml defines the version of all the dependencies for all modules in the dependencyManagement.
-
mvn siteto generate a reporting site. It is available intarget/site
Add -pl wegas-core by example to run the maven command only in the wegas-core module.
To get info about a goal, run something like mvn compiler:help -Ddetail=true -Dgoal=compile
Maven tool window (View -> Tool Windows -> Maven).
Dependency Analyzer editor (from Maven tool window > right-click on a Dependency > Analyze Dependencies... ).
There are actions for pom.xml files (right-click > Maven > ...).