Maven eclipse packaging "pom" not working

Sylordis

I'm using Eclipse Mars (4.5) with Maven 3.3.3.

Recently, I did a Maven update on a project Java 8 (SE), and all of the sudden, Eclipse didn't want the <packaging>jar</packaging> in my pom.xml to be valid, but wanted me to change the packaging to pom. Why can't I leave it to jar ?

Moreover, in the overview, the packaging choice is disabled.

When running maven from console (with jar packaging), this is what I get:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Child module C:\Users\Me\workspace\MyProject\? of C:\Users\Me\workspace\MyProject\pom.xml does not exist @
[ERROR] 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. @ line 8, column 13
 @
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Child module C:\Users\Me\workspace\MyProject\? of C:\Users\Me\workspace\MyProject\pom.xml does not exist @
[ERROR] 'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. @ line 8, column 13

        at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:422)
        at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
        at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
        at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
        at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR]   The project MyProject:model:0.2 (C:\Users\Me\workspace\MyProject\pom.xml) has 2 errors
[ERROR]     Child module C:\Users\Me\workspace\MyProject\? of C:\Users\Me\workspace\MyProject\pom.xml does not exist
[ERROR]     'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging. @ line 8, column 13

Can somebody help me ? at least in re-enabling jar packaging. Thanks.

EDIT: Indeed, somehow my pom.xml had some new lines added (I don't know why or how):

<modules>
    <module>?</module>
</modules>

That was what caused the issue. Removing it made the problem go away, thank you !

rec

Because if your pom declares modules it is an "aggregator POM" - aggregator modules must be pom. That is why you get the following error in your log:

[ERROR] 'packaging' with value 'jar' is invalid. 
    Aggregator projects require 'pom' as packaging. @ line 8, column 13

You can go back to jar when you remove all the <module> declarations from your pom.

Please refer to the documentation of multi-module projects.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Maven pom to have working cucumber

From Dev

Maven pom.xml error in eclipse

From Dev

Maven testResource filtering is not working in pom.xml

From Dev

Maven executable jar packaging vs Maven exec with Jackson not working

From Dev

Add Maven nature to existing Eclipse project that has pom but no Maven submenu

From Dev

Can I force Maven to build a JAR even though POM packaging specifies WAR?

From Dev

pom.xml greyed out when importing maven project into eclipse

From Dev

How to fix this maven warning on Eclipse: "There is no schema defined for this pom.xml"

From Dev

How to find list of conflicting jars in maven pom from eclipse

From Dev

How do I build my Maven pom in Eclipse?

From Dev

Spring Boot with POM packaging Agregator

From Dev

JMH not working in Eclipse (as Maven project) - No benchmarks to run

From Dev

Maven M2Eclipse plugin not working

From Dev

Eclipse maven jboss project - what do I need to add to the pom.xml so maven can compile?

From Dev

Modules packaging in maven

From Dev

Eclipse maven-jar-plugin not signing, because of duplicate entries pom.xml and pom.properties only on Windows

From Dev

'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging

From Dev

How to define access rules for classpath entries in maven pom.xml file for Eclipse & M2E?

From Dev

Why is maven dependency being added automatically to pom when using Eclipse (STS 3.5.1)?

From Dev

Eclipse stopped building my WAR file after some Maven pom.xml changes

From Dev

Getting maven project version and artifact ID from pom while running in Eclipse

From Dev

Maven root pom.xml marked as red when importing existing project into eclipse

From Dev

Maven Project with multi modules is unable to find pom.xml of modules - Jenkins/Eclipse

From Dev

can not create src/test/java module jar consistently using maven pom with eclipse

From Dev

Maven Project with multi modules is unable to find pom.xml of modules - Jenkins/Eclipse

From Dev

Only projects with 'pom' packaging can declare modules

From Dev

POM packaging option jar to war change error

From Dev

Maven package effective pom

From Dev

maven update pom property

Related Related

  1. 1

    Maven pom to have working cucumber

  2. 2

    Maven pom.xml error in eclipse

  3. 3

    Maven testResource filtering is not working in pom.xml

  4. 4

    Maven executable jar packaging vs Maven exec with Jackson not working

  5. 5

    Add Maven nature to existing Eclipse project that has pom but no Maven submenu

  6. 6

    Can I force Maven to build a JAR even though POM packaging specifies WAR?

  7. 7

    pom.xml greyed out when importing maven project into eclipse

  8. 8

    How to fix this maven warning on Eclipse: "There is no schema defined for this pom.xml"

  9. 9

    How to find list of conflicting jars in maven pom from eclipse

  10. 10

    How do I build my Maven pom in Eclipse?

  11. 11

    Spring Boot with POM packaging Agregator

  12. 12

    JMH not working in Eclipse (as Maven project) - No benchmarks to run

  13. 13

    Maven M2Eclipse plugin not working

  14. 14

    Eclipse maven jboss project - what do I need to add to the pom.xml so maven can compile?

  15. 15

    Modules packaging in maven

  16. 16

    Eclipse maven-jar-plugin not signing, because of duplicate entries pom.xml and pom.properties only on Windows

  17. 17

    'packaging' with value 'jar' is invalid. Aggregator projects require 'pom' as packaging

  18. 18

    How to define access rules for classpath entries in maven pom.xml file for Eclipse & M2E?

  19. 19

    Why is maven dependency being added automatically to pom when using Eclipse (STS 3.5.1)?

  20. 20

    Eclipse stopped building my WAR file after some Maven pom.xml changes

  21. 21

    Getting maven project version and artifact ID from pom while running in Eclipse

  22. 22

    Maven root pom.xml marked as red when importing existing project into eclipse

  23. 23

    Maven Project with multi modules is unable to find pom.xml of modules - Jenkins/Eclipse

  24. 24

    can not create src/test/java module jar consistently using maven pom with eclipse

  25. 25

    Maven Project with multi modules is unable to find pom.xml of modules - Jenkins/Eclipse

  26. 26

    Only projects with 'pom' packaging can declare modules

  27. 27

    POM packaging option jar to war change error

  28. 28

    Maven package effective pom

  29. 29

    maven update pom property

HotTag

Archive