I have a question about Maven, the maven-release-plugin, git integration, pom.xml's, and having pom.xml's in subdirectories of the repo's local copy rather than in the root.
Here's the setup:
Here's the actual error I get during this process:
[INFO] --- maven-release-plugin:2.0:perform (default-cli) @ standard_parent_project ---
[INFO] Checking out the project to perform the release ...
[INFO] Executing: /bin/sh -c cd "/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target" && git clone [email protected]:clarafaction/0maven.git '/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target/checkout'
...
/* note, the pom.xml the build should go out of at this point is at
'/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target/checkout/standard_parent_project/pom.xml'
*/
...
[INFO] [ERROR] The goal you specified requires a project to execute but
there is no POM in this directory
(/Users/___/DEV c8ion 01/maven_based_code/0maven/standard_parent_project/target/checkout).
Please verify you invoked Maven from the correct directory. -> [Help 1]
Thanks.
This should do the trick:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>your_path/your_pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
You can do it in the same way you normally tell Maven to run from a POM that's somewhere else: the -f
option. mvn --help
describes it thusly:
-f,--file <arg> Force the use of an alternate POM
file.
To do that in a release, you just need to pass the appropriate option to the release plugin. You can use the perform goal's "arguments" property to do that. This property just tells the release plugin some additional arguments to append to the mvn
command it runs when doing the release. You can set it from the command line by appending -D arguments="-f path/to/pom"
or set it permanently in the pom in the release plugin's configuration, something like
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.3</version>
<configuration>
<arguments>-f path/to/pom</arguments>
</configuration>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With