Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Validate Maven values in Java

This might be an easy task so I believe there should be something out there already. I'm trying to validate Maven related stuff like: artifact ID, group ID, Java package name, Version and a path.

Those are going to be provided from a NetBeans plug in in order to generate a maven project, thus need to be verified from the plugin before even attempting to create the project. (More friendly than letting the process blow up).

Right now I'm trying to verify with Java string checks but there should be something better like a regex.

Any ideas?

like image 436
javydreamercsw Avatar asked Nov 05 '22 17:11

javydreamercsw


1 Answers

You can use maven's Model class and validate with their ModelValidator.

like image 62
Tomas F Avatar answered Nov 10 '22 15:11

Tomas F