Trying to run and build my first Citrus project

358 views Asked by At

Trying to create and run my first Citrus test project. I am having no luck doing that. Following the documentation in 4.1.1 I invoke

mvn archetype:generate -Dfilter=com.consol.citrus.mvn:citrus

It fails. Not exactly what I expected. This is the error message

No plugin found for prefix '.consol.citrus.mvn' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\brian.m2\repository), central (https://repo.maven.apache.org/maven2)]

I don't even HAVE a current project yet. This procedure is supposed to create that project for me.

For some reason I did exactly the same thing on another system and it worked. It created a maven pom file as expected. But when I opened the maven project in Eclipse and ran it, it gave me errors on the log4j configuration. Of course I had to guess the location of the main file. I selected the citrus main. Also not what I would expect. The log4j xml config file was clearly present. I had the TestNG plugin installed.

But on this system, I cannot even do step one. Anyone have any ideas what could be wrong? I cannot step back any further than the first step!

3

There are 3 answers

0
Brian Reinhold On BEST ANSWER

It turns out that the error is caused by trying to run the command in the new Windows powershell. If one uses the start menu and runs the command prompt instead, the maven command will work as expected. At this time I have no idea why it does not work as expected in the powershell. Certainly the last thing I expected.

The unfortunate aspect of this Windows 10 update is that within the file explorer when you right click to get a command prompt, one now gets the power shell and the only way one can get the command prompt is to go to the start menu and specifically run the command prompt.

I have the same results on two separate systems.

0
Susantha Pathirana On

This issue will be fine if you open command prompt by start menu. Also there is way to open command prompt in folder location by following below steps.

  1. Go to folder location where you want to open command prompt.
  2. Go to address bar and delete path and type "cmd" there.
  3. Press enter button
  4. command prompt will be opened within same location.
3
Christoph Deppisch On

You need connection to the internet on that system in order to let Maven download the needed artifacts from central. Also import the project as Maven project in Eclipse. This will set up all source folders for you so also log4j config is foud automatically. And execute the tests via Maven or TestNG plugin in Eclipse. No need to define the main class at all.