[xwiki-users] Failure while trying to follow "Writing XWiki components" tutorial
When I try to use Maven as described in the tutorial, I get an error: PS D:\Data\Java\x> mvn archetype:generate -DarchetypeArtifactId=xwiki-commons-component-archetype -DarchetypeGroupId=org.xwiki.commons -DarchetypeVersion=3.3 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.130s [INFO] Finished at: Mon May 28 16:35:02 BST 2012 [INFO] Final Memory: 2M/15M [INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Data\Java\x). Please verify you invoked Maven from the correct directory. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException I'm a little concerned about the "-DarchetypeVersion=3.3" flag. I'm using XWiki 4.0. Is this page out of date? Sorry if I haven't given the right details, I haven't used Maven before so I'm not sure what I should do next. Paul.
On 05/28/2012 11:39 AM, Paul Moore wrote:
When I try to use Maven as described in the tutorial, I get an error:
PS D:\Data\Java\x> mvn archetype:generate -DarchetypeArtifactId=xwiki-commons-component-archetype -DarchetypeGroupId=org.xwiki.commons -DarchetypeVersion=3.3 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.130s [INFO] Finished at: Mon May 28 16:35:02 BST 2012 [INFO] Final Memory: 2M/15M [INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Data\Java\x). Please verify you invoked Maven from the correct directory. -> [Help 1]
That is not the right behavior of Maven... archetype:generate doesn't expect a pom to exist already, since the goal of this command is to generate a pom. What version of Maven are you using? mvn -version should print something like: Apache Maven 3.0.4
[ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
I'm a little concerned about the "-DarchetypeVersion=3.3" flag. I'm using XWiki 4.0. Is this page out of date?
Indeed, you should use the most recent (stable) version available, so 4.0
Sorry if I haven't given the right details, I haven't used Maven before so I'm not sure what I should do next.
Paul.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
On 28 May 2012 17:50, Sergiu Dumitriu <[email protected]> wrote:
On 05/28/2012 11:39 AM, Paul Moore wrote:
When I try to use Maven as described in the tutorial, I get an error:
PS D:\Data\Java\x> mvn archetype:generate -DarchetypeArtifactId=xwiki-commons-component-archetype -DarchetypeGroupId=org.xwiki.commons -DarchetypeVersion=3.3 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.130s [INFO] Finished at: Mon May 28 16:35:02 BST 2012 [INFO] Final Memory: 2M/15M [INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Data\Java\x). Please verify you invoked Maven from the correct directory. -> [Help 1]
That is not the right behavior of Maven... archetype:generate doesn't expect a pom to exist already, since the goal of this command is to generate a pom.
What version of Maven are you using?
mvn -version
should print something like:
Apache Maven 3.0.4
PS D:\Data> mvn -version Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000) Maven home: D:\Java\apache-maven-3.0.4\bin\.. Java version: 1.7.0_04, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_04\jre Default locale: en_GB, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
[ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
I'm a little concerned about the "-DarchetypeVersion=3.3" flag. I'm using XWiki 4.0. Is this page out of date?
Indeed, you should use the most recent (stable) version available, so 4.0
Same result :-( Paul.
I think it has more to do with the repository manager not knowing the version of archetype plugin to retrieve, or something like that. You should retry your command-line using full plugin specification : mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate -D.......(your options) You should only have to do this once, then using archetype:generate should be enough. Hope this helps, Jeremie 2012/5/28 Paul Moore <[email protected]>:
On 28 May 2012 17:50, Sergiu Dumitriu <[email protected]> wrote:
On 05/28/2012 11:39 AM, Paul Moore wrote:
When I try to use Maven as described in the tutorial, I get an error:
PS D:\Data\Java\x> mvn archetype:generate -DarchetypeArtifactId=xwiki-commons-component-archetype -DarchetypeGroupId=org.xwiki.commons -DarchetypeVersion=3.3 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.130s [INFO] Finished at: Mon May 28 16:35:02 BST 2012 [INFO] Final Memory: 2M/15M [INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Data\Java\x). Please verify you invoked Maven from the correct directory. -> [Help 1]
That is not the right behavior of Maven... archetype:generate doesn't expect a pom to exist already, since the goal of this command is to generate a pom.
What version of Maven are you using?
mvn -version
should print something like:
Apache Maven 3.0.4
PS D:\Data> mvn -version Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000) Maven home: D:\Java\apache-maven-3.0.4\bin\.. Java version: 1.7.0_04, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_04\jre Default locale: en_GB, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
[ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
I'm a little concerned about the "-DarchetypeVersion=3.3" flag. I'm using XWiki 4.0. Is this page out of date?
Indeed, you should use the most recent (stable) version available, so 4.0
Same result :-(
Paul. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On May 29, 2012, at 9:53 AM, Jeremie BOUSQUET wrote:
I think it has more to do with the repository manager not knowing the version of archetype plugin to retrieve, or something like that.
It uses the latest version so I don't think it's a version issue. However, maybe the FQN will help indeed.
You should retry your command-line using full plugin specification :
mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate -D.......(your options)
You should only have to do this once, then using archetype:generate should be enough.
Let us know Paul. If it works it would be nice to add the information to http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents Thanks -Vincent
Hope this helps, Jeremie
2012/5/28 Paul Moore <[email protected]>:
On 28 May 2012 17:50, Sergiu Dumitriu <[email protected]> wrote:
On 05/28/2012 11:39 AM, Paul Moore wrote:
When I try to use Maven as described in the tutorial, I get an error:
PS D:\Data\Java\x> mvn archetype:generate -DarchetypeArtifactId=xwiki-commons-component-archetype -DarchetypeGroupId=org.xwiki.commons -DarchetypeVersion=3.3 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.130s [INFO] Finished at: Mon May 28 16:35:02 BST 2012 [INFO] Final Memory: 2M/15M [INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Data\Java\x). Please verify you invoked Maven from the correct directory. -> [Help 1]
That is not the right behavior of Maven... archetype:generate doesn't expect a pom to exist already, since the goal of this command is to generate a pom.
What version of Maven are you using?
mvn -version
should print something like:
Apache Maven 3.0.4
PS D:\Data> mvn -version Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000) Maven home: D:\Java\apache-maven-3.0.4\bin\.. Java version: 1.7.0_04, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_04\jre Default locale: en_GB, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
[ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
I'm a little concerned about the "-DarchetypeVersion=3.3" flag. I'm using XWiki 4.0. Is this page out of date?
Indeed, you should use the most recent (stable) version available, so 4.0
Same result :-(
Paul.
On 29 May 2012 09:28, Vincent Massol <[email protected]> wrote:
On May 29, 2012, at 9:53 AM, Jeremie BOUSQUET wrote:
I think it has more to do with the repository manager not knowing the version of archetype plugin to retrieve, or something like that.
It uses the latest version so I don't think it's a version issue. However, maybe the FQN will help indeed.
You should retry your command-line using full plugin specification :
mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate -D.......(your options)
You should only have to do this once, then using archetype:generate should be enough.
Let us know Paul. If it works it would be nice to add the information to http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents
I'll try it this evening at home. For some reason, the XWiki site is unusably slow from work (15 minute page loads!) Seems to be caused by some form of proxy timeouts, and it only seems to affect my work connection, so I assume it's at my end. Paul.
After some googling, seems that archetype plugin likes to throw this error in some occasions completely unrelated to what the error message says ... Maybe you could also check : - there is no backslash "\" in your command-line - try adding more command-line options (specify -DgroupId , -Dversion, -DartifactId and so on to specify the coordinates of the project to create) 2012/5/29 Vincent Massol <[email protected]>:
On May 29, 2012, at 9:53 AM, Jeremie BOUSQUET wrote:
I think it has more to do with the repository manager not knowing the version of archetype plugin to retrieve, or something like that.
It uses the latest version so I don't think it's a version issue. However, maybe the FQN will help indeed.
You should retry your command-line using full plugin specification :
mvn org.apache.maven.plugins:maven-archetype-plugin:2.2:generate -D.......(your options)
You should only have to do this once, then using archetype:generate should be enough.
Let us know Paul. If it works it would be nice to add the information to http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents
Thanks -Vincent
Hope this helps, Jeremie
2012/5/28 Paul Moore <[email protected]>:
On 28 May 2012 17:50, Sergiu Dumitriu <[email protected]> wrote:
On 05/28/2012 11:39 AM, Paul Moore wrote:
When I try to use Maven as described in the tutorial, I get an error:
PS D:\Data\Java\x> mvn archetype:generate -DarchetypeArtifactId=xwiki-commons-component-archetype -DarchetypeGroupId=org.xwiki.commons -DarchetypeVersion=3.3 [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.130s [INFO] Finished at: Mon May 28 16:35:02 BST 2012 [INFO] Final Memory: 2M/15M [INFO] ------------------------------------------------------------------------ [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Data\Java\x). Please verify you invoked Maven from the correct directory. -> [Help 1]
That is not the right behavior of Maven... archetype:generate doesn't expect a pom to exist already, since the goal of this command is to generate a pom.
What version of Maven are you using?
mvn -version
should print something like:
Apache Maven 3.0.4
PS D:\Data> mvn -version Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000) Maven home: D:\Java\apache-maven-3.0.4\bin\.. Java version: 1.7.0_04, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_04\jre Default locale: en_GB, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
[ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
I'm a little concerned about the "-DarchetypeVersion=3.3" flag. I'm using XWiki 4.0. Is this page out of date?
Indeed, you should use the most recent (stable) version available, so 4.0
Same result :-(
Paul.
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
On 29 May 2012 09:47, Jeremie BOUSQUET <[email protected]> wrote:
After some googling, seems that archetype plugin likes to throw this error in some occasions completely unrelated to what the error message says ... Maybe you could also check : - there is no backslash "\" in your command-line
Other than the path to the "mvn" command, and paths in environment variables like JAVA_HOME, no, there are no backslashes (see the original mail in this thread).
- try adding more command-line options (specify -DgroupId , -Dversion, -DartifactId and so on to specify the coordinates of the project to create)
I'll see what I can do, but I have basically zero knowledge of Maven, so apologies in advance if any wild guesses I try just confuse things :-) Paul.
On 29 May 2012 10:09, Paul Moore <[email protected]> wrote:
On 29 May 2012 09:47, Jeremie BOUSQUET <[email protected]> wrote:
After some googling, seems that archetype plugin likes to throw this error in some occasions completely unrelated to what the error message says ... Maybe you could also check : - there is no backslash "\" in your command-line
Other than the path to the "mvn" command, and paths in environment variables like JAVA_HOME, no, there are no backslashes (see the original mail in this thread).
- try adding more command-line options (specify -DgroupId , -Dversion, -DartifactId and so on to specify the coordinates of the project to create)
I'll see what I can do, but I have basically zero knowledge of Maven, so apologies in advance if any wild guesses I try just confuse things :-)
Bizarre. It appears that it works in CMD.EXE fine, but fails in Powershell (which is my shell of choice). I have absolutely no idea why this might be the case. (A few minutes later, after some googling...) It appears that the "=" sign in the mvn command is treated specially by Powershell, and needs to be quoted when used in a mvn command. I've never encountered this before, and I suspect it's not *quite* that simple and somehow relates to the interaction of Powershell and the mvn command being a bat file. Nevertheless, quoting the -D parameters works in Powershell: mvn archetype:generate "-DarchetypeArtifactId=xwiki-commons-component-archetype" "-DarchetypeGroupId=org.xwiki.commons" "-DarchetypeVersion=4.0" "-DgroupId=com.acme" "-DartifactId=example" "-Dversion=1.0-SNAPSHOT" Paul.
participants (4)
-
Jeremie BOUSQUET -
Paul Moore -
Sergiu Dumitriu -
Vincent Massol