Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6919147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:57:10+00:00 2026-05-27T09:57:10+00:00

Just got a strange error. Working on project using JUnit and Maven 3.0.3 I’ve

  • 0

Just got a strange error. Working on project using JUnit and Maven 3.0.3 I’ve created in my test/src/java folder one test class – ClassifierUtilTest.java, with @Test-annotated methods and stuff, and two utility classes, just for the use in the testing env (one with few static methods for bypassing private visibility scopes and one mock for tested interface).

It works good under Maven 3.0.3 (mvn test), and in Eclipse 3.7 (run as / JUnit test), but when someone else tried to ‘mvn test‘ it with Maven 2.2.1 it failed. Apparently it tried to treat those util classes as test classes and failed due to ‘no @Test-annotated methods’ and ‘more than one constructor’.

It’s not JUnit fault (at least it shouldn’t be, maven dependency is the same, junit:junit:4.9), so it seems to be strictly maven or maven-surefire-plugin fault. I was wondering if there is some widely-known workaround for Maven 2.2.1 for this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:57:10+00:00Added an answer on May 27, 2026 at 9:57 am

    maven-surefire-plugin by default runs all the classes the have Test prefix or suffix (like yours ClassifierUtilTest) and TestCase suffix. Just change the name to ClassifierTestUtil and you’ll be fine.

    You can also exclude certain files/directories in pom.xml, see Inclusions and Exclusions of Tests:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.11</version>
      <configuration>
        <excludes>
          <exclude>**/ClassifierUtilTest.java</exclude>
        </excludes>
      </configuration>
    </plugin>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a strange problem. I've been using just javascript forever now, and I'm
I just randomly got this strange error via Rails 3, on heroku (postgres) PGError:
I'm a newbie to CakePHP but got strange error. I'm just testing it, how
I just change highscores.xml but suddenly I've got some strange error when i try
I've got a strange problem with SQL Server 2000, and I just can't think
Just got a request from my boss for an application I'm working on. Basically
Just got a question about generics, why doesn't this compile when using a generic
I just got done working through the Django tutorials for the second time, and
I just got this error message: ... from c:/ruby/lib/ruby/gems/1.8/gems/... ... 10 levels... from c:/ruby/lib/ruby/gems/1.8/gems/...
I just got a strange problem. I am including some files from my index.php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.