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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:21:11+00:00 2026-05-26T02:21:11+00:00

tl;dr-edition: I have a compilation I know that will fail, but want the subset

  • 0

tl;dr-edition: I have a compilation I know that will fail, but want the subset of classes that are still compilable in my target/classes folder after compilation. I have configured <failOnError>false</failOnError>, but no classes are generated, not even a dummy class that is independent of any other classes except Object. Is there some configuration to achieve this?


I have a maven-powered project whose workflow consists of basically the following (relevant) goals:

  • ...
  • init-compile

    The code generator (below) uses a config that is reflection-based, so, in a first pass, I want to try compile as much of the project as possible so that no ClassNotFoundExceptions are thrown there. This compilation is configured with <failOnError>false</failOnError> so that the build continues.

    Unfortunately (you could call it a design flaw), the config is used both for code generation (specifying the OWL file and namespace to package mappings) and at runtime, so it also contains other elements that are not needed for the code generator, but are still read and therefore needed on the classpath to succeed.

  • generate-model

    In this step, some model classes are generated from an OWL-Ontology, creating the code that makes the rest of the project completely compileable.

  • default-compile

    Now, the rest of the classes should be compiled, obviously

  • save-model

    Now, the instances from the ontology are read and serialized to a file for runtime

  • ...

Side note: both generate and save model use maven-exec-plugin, but I sincerely don’t think that matters at all.

Question:

When I run my build with mvn -e -U clean package source:jar javadoc:jar install:install, it fails during the generate-model goal with the errors I’m trying to avoid. target/classes is empty, so it seems that the compiler doesn’t spit out the subset of classes it could/should have been able to process. Is there a way to achieve this?

I have two workarounds in mind which I both don’t like:

  • Editing the config file “AST” before parsing it into Java-Objects, so that only the part relevant for the code generator is parsed (needs tweaking of code that I have access to but should be considered immutable by my project);
  • and to configure the init-compile goal to only include the needed classes (too inflexible, because the POM should/could be a template for future applications using the same model).

If you can imagine another way to work around my problem that you can see from my description, I would be glad to hear them, too!

  • 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-26T02:21:12+00:00Added an answer on May 26, 2026 at 2:21 am

    First, let me recapitulate your problem to be sure I’ve grasped it properly.

    • You have a set of classes whose function, in their compiled form, is
      to configure both the code generator and the runtime. (A subset of
      these are relevant to the code generator, but generation will fail
      unless the complete configuration is present. So we can treat it as
      though the entire configuration were necessary.)

    • You then have a set of classes which will be generated as source
      code. These have a generation-time, perhaps a compile-time, and a
      run-time dependency upon the configuration classes.

    • Finally you have some other code which has a compile-time dependency
      upon the generated classes, and a runtime dependency upon both the
      generated classes and the configuration classes.

    • However, your configuration classes don’t have any compile-time dependencies upon the generated classes nor upon the other code. You don’t explicitly say this, but I’m assuming it, otherwise you’ve got a circular dependency problem.

    Here’s my suggestion: Divide the project into a multi-module (“reactor”) project. Your current project will be a module of the reactor project. Create a new module called “config” or similar and move your config classes into it. Have the main module depend upon it.

    If you don’t like multi-module projects, you could achieve the same thing by declaring an extra execution of the compile plugin, bound to the generate-sources phase. (You don’t say, but I assume you’re doing the code generation in this phase. If you declare the compile plugin before the code generator plugin within the POM, Maven will execute them in the same order.) You would use the “include” filter of the compile plugin to compile only the config classes. For this, you would need to have the config classes in a separate package from all the rest, which is good practice anyway.

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

Sidebar

Related Questions

i have my C# program that work with sql-server 2008 Enterprise Edition i have
I have a SQL Server Compact Edition Database file, and I want to display
.NET 3.5 Visual Studio 2008 Team Edition I have an XML file that I've
I have installed SQL Server 2008 Standard edition and I want to upgrade it
I am looking for SQL Server Profiler in SQL Server 2008 express edition.I have
We have a Windows Server Web Edition 2003 Web Farm. What can we use
I have the VS2005 standard edition and MS says this: Note: The Windows Service
I have the SQL Server 2005 Developer Edition DVD. I have been trying to
I have a windows 2003 server (WEb edition) which has .net 3.5 sp1 installed
I have a SQL 2008 developer edition with SSRS and the report manager is

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.