1

Actually I want to run a java class while running mvn clean install on my project. I found that the best solution is to work with abstractMojo and define the treatment inside the execute method. Can you please give me a simple example that describes this mechanism ? .. Thank you

GHCoder
  • 21
  • 7
  • First you should think what kind of things you like to do using your class and what is the purpose. I have my doubts that you need to implement a plugin...Apart from that the starting point for implementing a plugin can be found here: http://maven.apache.org/guides/plugin/guide-java-plugin-development.html – khmarbaise Mar 21 '17 at 07:50
  • @khmarbaise Yea it is exactly what I want to do, I want to implement a plugin in my pom.xml file that call a class java that extends from AbstractMojo .. Actually I followed the same instructions of this website but I have got an error while running maven install ( cannot find artifact ..) – GHCoder Mar 21 '17 at 19:32
  • You haven't answered my question. I wanted to know what your plugin should do? – khmarbaise Mar 21 '17 at 20:46
  • @khmarbaise thé plugin should normally read my messages_lang.properties files an convert them into messages_lang.js .. this treatment should be done before running thé project because i need those js files in my app. – GHCoder Mar 21 '17 at 22:32

1 Answers1

1

I finally found thé solution of my problem. . Actually I used an other méthod : I used thé exec-maven-plugin and inside this plugin I defined m'y mainClass. . This class contains the treatment that I want to execute before running thé app.

GHCoder
  • 21
  • 7