You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by #ZHAO LIDA# <LI...@e.ntu.edu.sg.INVALID> on 2023/06/28 10:55:43 UTC

Possible improvements on Maven

Dear Maven maintainers,


we are studying Maven dependency specifications and we would like to offer several possible improvements for Maven.


(1) The scope management of Maven is complicated and hard to distinguish. Maven maintained 6 scopes (i.e., compile, runtime, provided, system, test, and import). Compare to newer package managers such as NPM, which only has two scopes (i.e., dependencies, devdependencies), Maven has too many types of scopes, which makes it more difficult for users to understand. We went over all POMs on the Maven Central (around 8M artifacts, collected in March 2022) and count the frequency of all types of scope. Some of the scopes are rarely used. Only 0.35% of POMs in the Maven Center used system scope. Also, system scope is similar to provided scope, and import scope can hardly be regarded as a dependency scope. We suggest simplifying the types of scopes by merging system into provided and removing import.


(2) In the documentation of Default Artifact Handlers (https://maven.apache.org/ref/3.9.3/maven-core/artifact-handlers.html), type and classifier should introduce more commonly used values as their default value to provide better examples. We found that the default values are rarely used and are not good examples for users to understand the use of the settings. Setting commonly used values as default can help users understand the usage of the settings. We went over all POMs on the Maven Central (around 8M artifacts, collected in March 2022) and count the frequency of all possible values of classifier and type. According to our research, in classifier, the default values have low frequencies, including tests (1.05%), javadoc (0.35%), sources (0.29%), and client(0.01%). More commonly used values are features (1.20%), linux-x86_64 (0.34%), and osx-x86_64 (0.27%). As for type, the top default values are pom (4.38%), test-jar (2.85%), war (1.08%) and the rest of the values are all below 0.1%. Other common examples are esa (2.53%), zip (1.88%), and xml (1.31%).


Regards,

NTU CSL


Re: Possible improvements on Maven

Posted by Elliotte Rusty Harold <el...@ibiblio.org>.
On Sat, Jul 1, 2023 at 6:11 AM #ZHAO LIDA# <LI...@e.ntu.edu.sg.invalid> wrote:
>
> Dear Maven maintainers,
>
>
> we are studying Maven dependency specifications and we would like to offer several possible improvements for Maven.
>
>
> (1) The scope management of Maven is complicated and hard to distinguish. Maven maintained 6 scopes (i.e., compile, runtime, provided, system, test, and import). Compare to newer package managers such as NPM, which only has two scopes (i.e., dependencies, devdependencies), Maven has too many types of scopes, which makes it more difficult for users to understand. We went over all POMs on the Maven Central (around 8M artifacts, collected in March 2022) and count the frequency of all types of scope. Some of the scopes are rarely used. Only 0.35% of POMs in the Maven Center used system scope. Also, system scope is similar to provided scope, and import scope can hardly be regarded as a dependency scope. We suggest simplifying the types of scopes by merging system into provided and removing import.

This would probably be a good idea if we were starting from a green
field, but backwards compatibility with a 20 year legacy trumps good
design. IMHO this isn't feasible.

> (2) In the documentation of Default Artifact Handlers (https://maven.apache.org/ref/3.9.3/maven-core/artifact-handlers.html), type and classifier should introduce more commonly used values as their default value to provide better examples. We found that the default values are rarely used and are not good examples for users to understand the use of the settings. Setting commonly used values as default can help users understand the usage of the settings. We went over all POMs on the Maven Central (around 8M artifacts, collected in March 2022) and count the frequency of all possible values of classifier and type. According to our research, in classifier, the default values have low frequencies, including tests (1.05%), javadoc (0.35%), sources (0.29%), and client(0.01%). More commonly used values are features (1.20%), linux-x86_64 (0.34%), and osx-x86_64 (0.27%). As for type, the top default values are pom (4.38%), test-jar (2.85%), war (1.08%) and the rest of the values are all below 0.1%. Other common examples are esa (2.53%), zip (1.88%), and xml (1.31%).

Maven's documentation is... Well, it is. That's about all I can say
for it. It's trivial to find parts that need work, anything from typo
fixes to rewrites from a blank page. Feel free to assign me as
reviewer on any PRs to improve this.

-- 
Elliotte Rusty Harold
elharo@ibiblio.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Possible improvements on Maven

Posted by Tomo Suzuki <su...@google.com.INVALID>.
1) I use “import” scope to define BOMs.

2) (I’m not a maintainer) I believe your pull request to enhance document
would be welcomed and will be a good start point for the discussion.

Regards,
Tomo


On Sat, Jul 1, 2023 at 02:11 #ZHAO LIDA# <LI...@e.ntu.edu.sg.invalid>
wrote:

> Dear Maven maintainers,
>
>
> we are studying Maven dependency specifications and we would like to offer
> several possible improvements for Maven.
>
>
> (1) The scope management of Maven is complicated and hard to distinguish.
> Maven maintained 6 scopes (i.e., compile, runtime, provided, system, test,
> and import). Compare to newer package managers such as NPM, which only has
> two scopes (i.e., dependencies, devdependencies), Maven has too many types
> of scopes, which makes it more difficult for users to understand. We went
> over all POMs on the Maven Central (around 8M artifacts, collected in March
> 2022) and count the frequency of all types of scope. Some of the scopes are
> rarely used. Only 0.35% of POMs in the Maven Center used system scope.
> Also, system scope is similar to provided scope, and import scope can
> hardly be regarded as a dependency scope. We suggest simplifying the types
> of scopes by merging system into provided and removing import.
>
>
> (2) In the documentation of Default Artifact Handlers (
> https://maven.apache.org/ref/3.9.3/maven-core/artifact-handlers.html),
> type and classifier should introduce more commonly used values as their
> default value to provide better examples. We found that the default values
> are rarely used and are not good examples for users to understand the use
> of the settings. Setting commonly used values as default can help users
> understand the usage of the settings. We went over all POMs on the Maven
> Central (around 8M artifacts, collected in March 2022) and count the
> frequency of all possible values of classifier and type. According to our
> research, in classifier, the default values have low frequencies, including
> tests (1.05%), javadoc (0.35%), sources (0.29%), and client(0.01%). More
> commonly used values are features (1.20%), linux-x86_64 (0.34%), and
> osx-x86_64 (0.27%). As for type, the top default values are pom (4.38%),
> test-jar (2.85%), war (1.08%) and the rest of the values are all below
> 0.1%. Other common examples are esa (2.53%), zip (1.88%), and xml (1.31%).
>
>
> Regards,
>
> NTU CSL
>
> --
Regards,
Tomo

Re: Possible improvements on Maven

Posted by Tamás Cservenák <ta...@cservenak.net>.
Howdy,

That's cool, thanks for the feedback.

(1) the system scope is deprecated since Maven 3 (2010?), and since similar
timeframe, it is not allowed to deploy artifacts using system scope to
Maven Central anymore, see
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#system-dependencies

(2) OTOH, around same time, deployment of sources and javadoc became
mandatory (exclusions are AFAIK some non fully OSS artifacts that allow
distribution via Maven Central) but in general, Maven itself defines
"common types" supported by Maven Core, while this system is extensible and
is extended by various plugins and extensions. Core defined ones are
intentionally kept at minimum.

HTH
T

On Sat, Jul 1, 2023, 08:11 #ZHAO LIDA# <LI...@e.ntu.edu.sg.invalid> wrote:

> Dear Maven maintainers,
>
>
> we are studying Maven dependency specifications and we would like to offer
> several possible improvements for Maven.
>
>
> (1) The scope management of Maven is complicated and hard to distinguish.
> Maven maintained 6 scopes (i.e., compile, runtime, provided, system, test,
> and import). Compare to newer package managers such as NPM, which only has
> two scopes (i.e., dependencies, devdependencies), Maven has too many types
> of scopes, which makes it more difficult for users to understand. We went
> over all POMs on the Maven Central (around 8M artifacts, collected in March
> 2022) and count the frequency of all types of scope. Some of the scopes are
> rarely used. Only 0.35% of POMs in the Maven Center used system scope.
> Also, system scope is similar to provided scope, and import scope can
> hardly be regarded as a dependency scope. We suggest simplifying the types
> of scopes by merging system into provided and removing import.
>
>
> (2) In the documentation of Default Artifact Handlers (
> https://maven.apache.org/ref/3.9.3/maven-core/artifact-handlers.html),
> type and classifier should introduce more commonly used values as their
> default value to provide better examples. We found that the default values
> are rarely used and are not good examples for users to understand the use
> of the settings. Setting commonly used values as default can help users
> understand the usage of the settings. We went over all POMs on the Maven
> Central (around 8M artifacts, collected in March 2022) and count the
> frequency of all possible values of classifier and type. According to our
> research, in classifier, the default values have low frequencies, including
> tests (1.05%), javadoc (0.35%), sources (0.29%), and client(0.01%). More
> commonly used values are features (1.20%), linux-x86_64 (0.34%), and
> osx-x86_64 (0.27%). As for type, the top default values are pom (4.38%),
> test-jar (2.85%), war (1.08%) and the rest of the values are all below
> 0.1%. Other common examples are esa (2.53%), zip (1.88%), and xml (1.31%).
>
>
> Regards,
>
> NTU CSL
>
>

Re: Possible improvements on Maven

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

On 28.06.23 12:55, #ZHAO LIDA# wrote:
> Dear Maven maintainers,
>
>
> we are studying Maven dependency specifications and we would like to offer several possible improvements for Maven.
>
>
> (1) The scope management of Maven is complicated and hard to distinguish. Maven maintained 6 scopes (i.e., compile, runtime, provided, system, test, and import).

As already mentioned system-scope is deprecated for a long time..


> Compare to newer package managers such as NPM, which only has two scopes (i.e., dependencies, devdependencies),

others have already mentioned that it has more of them.


> Maven has too many types of scopes, which makes it more difficult for users to understand.

Some people say even it has not enough of them. Having a more fine
grained control..


> We went over all POMs on the Maven Central (around 8M artifacts, collected in March 2022) and count the frequency of all types of scope. Some of the scopes are rarely used. Only 0.35% of POMs in the Maven Center used system scope.

That's really good...this can only be very old artifacts.


> Also, system scope is similar to provided scope, and import scope can hardly be regarded as a dependency scope.

provided is completely different to provided..


> We suggest simplifying the types of scopes by merging system into provided and removing import.

theoretically we could do something like that, but unfortunately we can
not break all 8 M artifacts...


>
>
> (2) In the documentation of Default Artifact Handlers (https://maven.apache.org/ref/3.9.3/maven-core/artifact-handlers.html),

 > type and classifier should introduce more commonly used values as
their default value to provide better examples.

 >We found that the default values are rarely used and are not good
examples for
 > users to understand the use of the settings.


Setting commonly used values as default can help users understand the
usage of the settings. We went over all POMs on the Maven Central
(around 8M artifacts, collected in March 2022) and count the frequency
of all possible values of classifier and type. According to our
research, in classifier, the default values have low frequencies,
including tests (1.05%),

 > javadoc (0.35%), sources (0.29%)

looks a bit strange because all artifacts which will be uploaded to
central have to have sources/javadoc ... have you checked the pom files
or the artifacts in central? Often generation of sources/javadoc or
alike a done via profiles in pom files...

Means have you used search.maven.org ?


and client(0.01%). More commonly used values are features (1.20%),

> linux-x86_64 (0.34%), and osx-x86_64 (0.27%).

Could be dependent on OSGi packages...


> As for type, the top default values are pom (4.38%),

> test-jar (2.85%), war (1.08%) and the rest of the values are all below 0.1%.


> Other common examples are esa (2.53%), zip (1.88%), and xml (1.31%).


Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Possible improvements on Maven

Posted by Pavel Horal <pa...@orchitech.cz>.
Hi,

not a maintainer here, but just want to add to this:

> Compare to newer package managers such as NPM, which only has two scopes
(i.e., dependencies, devdependencies)

NPM has dependencies, devDependencies, peerDependencies, bundleDependencies
and optionalDependencies :)

Pavel

On Sat, 1 Jul 2023 at 08:11, #ZHAO LIDA# <LI...@e.ntu.edu.sg.invalid>
wrote:

> Dear Maven maintainers,
>
>
> we are studying Maven dependency specifications and we would like to offer
> several possible improvements for Maven.
>
>
> (1) The scope management of Maven is complicated and hard to distinguish.
> Maven maintained 6 scopes (i.e., compile, runtime, provided, system, test,
> and import). Compare to newer package managers such as NPM, which only has
> two scopes (i.e., dependencies, devdependencies), Maven has too many types
> of scopes, which makes it more difficult for users to understand. We went
> over all POMs on the Maven Central (around 8M artifacts, collected in March
> 2022) and count the frequency of all types of scope. Some of the scopes are
> rarely used. Only 0.35% of POMs in the Maven Center used system scope.
> Also, system scope is similar to provided scope, and import scope can
> hardly be regarded as a dependency scope. We suggest simplifying the types
> of scopes by merging system into provided and removing import.
>
>
> (2) In the documentation of Default Artifact Handlers (
> https://maven.apache.org/ref/3.9.3/maven-core/artifact-handlers.html),
> type and classifier should introduce more commonly used values as their
> default value to provide better examples. We found that the default values
> are rarely used and are not good examples for users to understand the use
> of the settings. Setting commonly used values as default can help users
> understand the usage of the settings. We went over all POMs on the Maven
> Central (around 8M artifacts, collected in March 2022) and count the
> frequency of all possible values of classifier and type. According to our
> research, in classifier, the default values have low frequencies, including
> tests (1.05%), javadoc (0.35%), sources (0.29%), and client(0.01%). More
> commonly used values are features (1.20%), linux-x86_64 (0.34%), and
> osx-x86_64 (0.27%). As for type, the top default values are pom (4.38%),
> test-jar (2.85%), war (1.08%) and the rest of the values are all below
> 0.1%. Other common examples are esa (2.53%), zip (1.88%), and xml (1.31%).
>
>
> Regards,
>
> NTU CSL
>
>