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 3782080
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:01:58+00:00 2026-05-19T11:01:58+00:00

I inherited a Maven project/module that failed when I switched from Maven 2 to

  • 0

I inherited a Maven project/module that failed when I switched from Maven 2 to Maven 3. It hinges on the execution of an external program that depends on the contents of project/module/target/classpath.txt. This file is generated by a custom plugin that uses ${project.compileClasspathElements}.

In Maven 2 this contained:

project/module/target/classes
[all my dependencies in my local repository]

But in Maven 3, the classpath.txt file only contains:

project/module/target/classes

In other words, the file is missing all the actual dependencies, save for the build directory. Was there a change between Maven 2 and Maven 3 regarding project.compileClasspathElements? How can I get all the dependencies back so that it will work like Maven 2?

[This question was edited to reflect the source of classpath.txt, which I only just discovered.]

  • 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-19T11:01:59+00:00Added an answer on May 19, 2026 at 11:01 am

    Just encountered this issue when migrating a maven 2 plugin that executes during the package phase. Fixed by adding

    @requiresDependencyResolution compile+runtime
    

    to the Mojo, e.g.

    /**
     * blah blah blah
     *
     * @goal validate-security
     * @phase package
     * @requiresDependencyResolution compile+runtime
     */
    public class SecurityValidationMojo extends AbstractMojo { ... }
    

    From http://maven.apache.org/developers/mojo-api-specification.html

    If this annotation is present but no scope is specified, the scope defaults to runtime. If the annotation is not present at all, the mojo must not make any assumptions about the artifacts associated with a Maven project.

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

Sidebar

Related Questions

I inherited a project that uses SQL Server 200x, wherein a column that stores
I have a multi module Maven project and I want the sub projects to
There is a multi-module Maven-3 project, where one of sub-modules is used as <dependency>
Ive got a Maven project ive inherited which has no profiles setup, however I
I am switching a project from Ant to Maven. I have my unit tests
I inherited a substantial amount of code, including a visual studio project that is
I inherited a very large subsystem from a programmer that left the company and
I inherited a database built with the idea that composite keys are much more
I inherited MYSQL database that has lots of tables with data like CREATE TABLE
I am currently struggling with Maven: I have a complex project made of several

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.