3

I am trying to use the maven-release-plugin 2.3.2 on a multi module POM. (Maven 3.0.4)

release:prepare works fine but release:perform fails with this error

[INFO] org.apache.maven.lifecycle.MissingProjectException: The goal you specified 
requires a project to execute but there is no POM in this directory (...<workspace>/target
/checkout). Please verify you invoked Maven from the correct directory.

Now the parent POM lies inside this <workspace>/ but in the <workspace>/target/checkout there is no POM as the target directory was created by the plugin. I am assuming there should be a copy of the pom.xml here which should be created by the plugin and that is why the error.

What I am doing wrong ? Directory and POM structure attached. Module 1 and 2 both have respective pom.xmls in root.


dir structure


I have looked at maven release plugin, git, and the pom's not at the top , maven generating pom file , Maven 3.0's "mvn release:perform" doesn't like a pom.xml that isn't in its git repo's root directory . They don't help as my pom already lies in the repo's (SVN) root directory and this directory where the plugin is looking for the POM is only temporary, so I cannot/should not hard-code it.

Community
  • 1
  • 1
Pulak Agrawal
  • 2,481
  • 4
  • 25
  • 49
  • Can you show the directory layout and where your pom's are located? – khmarbaise Dec 14 '12 at 08:02
  • 2
    Is the given pom.xml which is located in the root of your multi-module build correctly checked-in in SVN at the same position? Have you started the mvn release:prepare and mvn release.perform from the root of the multi-module build? – khmarbaise Dec 14 '12 at 08:29
  • fixed it.. wrong path in the `` tag in the parent POM.. @khmarbaise your comment got me thinking that the `path in SVN=Jenkins workspace=path in ` is the only way it can work – Pulak Agrawal Dec 14 '12 at 08:59
  • can you help me out what should be the path in pom.xml.I have same error and I have already more than 2 days in this. – JDGuide Sep 06 '13 at 07:38

2 Answers2

4

Fixed it.. wrong path in the tag in the parent POM. Comment from khmarbaise got me thinking that the path in SVN=Jenkins workspace=path in is the only way it can work and thats how it did.

Pulak Agrawal
  • 2,481
  • 4
  • 25
  • 49
  • Hi , what should be the SCM . Is it nexus repository or what exactly that ? – JDGuide Sep 06 '13 at 07:41
  • @JDeveloper its a full path to your source code location including VCS tool name. In SVN it could mean a branch or trunk e.g ` scm:svn:file:///D:/subversion_data/repos/my_repo/my-app-example/trunk ` Check [here](http://maven.apache.org/guides/mini/guide-releasing.html) or [here - search for scm](https://weblogs.java.net/blog/johnsmart/archive/2008/08/using_the_maven.html) – Pulak Agrawal Sep 07 '13 at 04:50
  • Also you can pass these values as `-Dparamaters`. The parameters are `connection , developerConnection and url`. Its good to give all 3, though you can live without the `url` – Pulak Agrawal Sep 07 '13 at 04:54
  • What are the odds... I made the exact same mistake. – jgitter May 12 '15 at 19:38
0

Make sure you have not committed target folder in the project structure, due to which its checking out in that folder, and hence not able to find the pom file.

I faced the similar issue.:)

Kiran
  • 1