You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gogirl <cl...@gmail.com> on 2012/02/17 21:52:07 UTC

My TestNG dependency not found :-(

I have successfully used the quickstart archetype and proceeded to build and
run
HelloWorld. As most know, it uses junit and i wish to use TestNG. I believed
that it meant that 
I would simply add the needed dependency as explained here:
http://maven.apache.org/plugins/maven-surefire-plugin/examples/testng.html
To keep it simple, I am calling mvn from the console.
I used the Intellij Editor only to modify the pom file. The editor tells me
that the org.testng, testing and test in my testng dependency are not found.
What am I missing? I thought that I was free to modify the pom file and add
files as i want and then I could just build again.

My assumption is that I may add as many dependencies as I like to my list.
So if I like to have two test files to exemplify how things are done in
junit and testng
all that should be needed is to add a new test file with the appropriate
import statements.

<dependencies>
      <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
      </dependency>

  <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.3.1</version>
        <scope>test</scope>
   </dependency>
  </dependencies>

--
View this message in context: http://maven.40175.n5.nabble.com/My-TestNG-dependency-not-found-tp5493958p5493958.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: My TestNG dependency not found :-(

Posted by Wayne Fay <wa...@gmail.com>.
> I would simply add the needed dependency as explained here:
> http://maven.apache.org/plugins/maven-surefire-plugin/examples/testng.html

Yes, that is correct.

> To keep it simple, I am calling mvn from the console.

Good. IDEs are fine once you are an advanced user but not appropriate
(IMO) for beginners because they hide too many details and end up
confusing the user.

> I used the Intellij Editor only to modify the pom file. The editor tells me
> that the org.testng, testing and test in my testng dependency are not found.

Honestly, why do you care what the IntelliJ editor says? Does Maven
work OK from the console? If so, ignore IntelliJ.

> What am I missing? I thought that I was free to modify the pom file and add
> files as i want and then I could just build again.

Keep in mind what Brian told you already:
What this means is when you make changes to your IDEA project, it
won't (at least with any feature I am familiar with) rewrite your POM
for you.  You must hand-code the POM, then IDEA will notice that
you've changed it and ask if you want to re-import.

I am guessing that you made changes but did not re-import yet.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org