Reputation: 2621
I have a directory which contains *.java files generated by a C++ project build.
I need a command line to create a *.jar file which :
I need this command line to be executed in a post-build for my C++ project build.
Thank you
Upvotes: 0
Views: 2418
Reputation: 993
Assuming you have a correct pom.xml you can start maven with the following command:
mvn clean install -Dproject.build.sourceDirectory=<your directory>
Though maven can be irritating when you don't use the default of "src/main/java"
Regarding 2.:
Passing the java package as a command line parameter is problematic, as the .java-Files must declare the correct package and must be located in a matching directory.
You could use the filtering mechanism of the maven-resources-plugin to replace a wildcard in your source files with the actual package, but you would need an existing pom.xml with the configuration for the plugin.
Upvotes: 1