I need to build my Dart project with Maven.
I've found dart-maven-plugin for this goal, and it works fine for resolving dependencies.
In Dart I compile my project with two commands:
pub get
pub build
So, when I write
mvn dart:pub
it gets all dependencies.
Now I need to build my project. So, I write
mvn dart:pub -DpubCommand=build
but it's still resolving dependencies, it doesn't build the project!
How can I build project with dart-maven-plugin?
I've wrote wrong parameter name. Correctly will be:
Also there is example project name - "dart-maven-plugin-example"
Don't build this project, it will not build cause there is no web folder in some sub-projects.
Hope it will help some one else.
If you want to do this you can just add this ant plugin to your project:
These two ant tasks will run 'pub build' and then copy your build files to the approriate directory. This here is set up for a spring boot app that is serving files from the static folder. You can change the locations of the files. Replace the 'your-dart-project-name' with your dart project name. The '*/**' is an ant matcher that will match all files recursively.
The exec command requires that you have added your dart-sdk 'bin' folder to your classpath. That will let pub be executable.