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

  • Home
  • SEARCH
  • 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 8608771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:42:03+00:00 2026-06-12T03:42:03+00:00

I have a Jackson services project in Eclipse that uses Maven for the build

  • 0

I have a Jackson services project in Eclipse that uses Maven for the build process, and I have several “test only” endpoints that are necessary for the unit tests, but should be removed for the public build. Is there an annotation, or other configuration property I can set so that in the build process (after the unit tests pass), the endpoint will not be deployed?

For example, I have a method like:

@GET
@Path("/{user}/addresses")
@Produces(MediaType.APPLICATION_JSON)
public Map<String, Object> getUserAddresses(...){ ... }

And when this is published, user addresses will come from a 3rd party system, but for testing, we need a way to add an address, so i have

@POST
@Path("/{user}/address")
@Produces(MediaType.APPLICATION_JSON)
public Map<String, Object> createAddress(

but I want the 2nd method to never exist on the live server.

  • 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-06-12T03:42:05+00:00Added an answer on June 12, 2026 at 3:42 am

    I would just put the “test only” classes in src/test/java. There is no rule that the only things that can appear in src/test/java are unit tests only.

    This way you have nothing extra to configure with Maven to exclude classes.

    Alternatively, you could tell the maven-jar-plugin or maven-war-plugin to exclude specific classes from being packaged in the final artifact, but this has the downside of not being able to catch a case where you accidentally import one of the “test only” classes in a real class and thus you ship something in your jar/war that will cause a NoClassDefFoundError. If you place the “test-only” classes in src/test/java instead, and therefore ensure they are only on the test classpath, this accidental import problem will not be possible (compilation of the main code will fail).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a spring mvc project and am trying to test out a rest
I have an Android app which uses Jackson parser for JSON parsing. After I've
I have a Jackson Question. Is there a way to deserialize a property that
I have successfully set up a quick test of creating a REST-like service that
There's a project use Jackson, and have a Java object Data. In the object,
A CXF JAX-RS application I have uses jackson to marshal POJOs to JSON. This
I have a class that needs to be deserialized from JSON using Jackson. The
have 2 questions : A computer with 32-bit address uses 2-level page table (9
I have the following arrays: $artist = ["the roots", "michael jackson", "billy idol", "more",
I have a Spring MVC backend that needs to start handling new URLs that

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.