1

From the Maven projects which I have seen, a Maven project seems to always correspond to a Java package.

So is a Maven project necessarily a Java package?

Note that package is a concept in Java language, while project is a concept in Maven.

Thanks.

Tim
  • 1
  • 141
  • 372
  • 590
  • 3
    No it's not, but usual nomenclature is as follow: groupId correspond to your firm/organisation (with dots), artifactId is a unique identifier of your module, separated with dash, and the root package of the module is usually the concatenation of groupId + artifactId converted to a java package name. But that's only a convention, you can name the package whatever you want. – spi Jan 24 '18 at 17:01
  • 1
    There's nothing preventing a maven project from being _multiple_ Java packages... there's also nothing preventing a maven project from running shell scripts, so I suppose you could also invoke a C compiler, or format your hard drive. :) – Siguza Jan 24 '18 at 17:03
  • No. Maven needn't be related to Java at all. You could use it for any language but in practice no one does. – Michael Jan 24 '18 at 17:07
  • A Maven Project is a Project manipulated by the Maven tool, in this case a JavaProject. – Cowboy Farnz Jan 24 '18 at 17:09
  • "Java package" has a defined meaning in the Java world and is probably not what you mean here. I guess you mean jar file. But even then, as others have already commented, a jar is not the only artefact type that can be built. – Henry Jan 24 '18 at 17:57

1 Answers1

2

There are no relation between Java packages and Maven project.

Maven is building tool and java packages are pure abstraction to it. You can have this impression as most popular naming convention for naming maven project is to set group id same as root package for project.

user902383
  • 8,420
  • 8
  • 43
  • 63