Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce extraneous maven warnings in build log #29

Open
amclin opened this issue Nov 5, 2018 · 1 comment
Open

Reduce extraneous maven warnings in build log #29

amclin opened this issue Nov 5, 2018 · 1 comment
Labels
help wanted Extra attention is needed techdebt Technical Debt that needs to be improved

Comments

@amclin
Copy link
Owner

amclin commented Nov 5, 2018

Is your feature request related to a problem? Please describe.
Having extraneous warnings in logs makes it harder to identify problems. Running this plugin generates maven warnings that can probably be avoided.

Describe the solution you'd like
Maven warns against having dynamic values in specific properties to reduce the risk of generating malformed packages. The normal expectation is that these properties are defined explicitilty as the pom.xml is the source of truth. However, since this plugin moves the responsibility of the source of truth outside of Maven to the NPM package, they must be dynamically populated.

Investigate alternative approaches to specifying these required details without triggering warnings. A few options could include

  1. Changing how variables are used in the pom.xml to not rely on package properties
  2. Generating temporary static pom.xml files instead of using Maven variables

Additional context
Maven log:

Starting AEM Packager.
Processing list of Defines.
Generating a default JCR installation path.
Package contents will be installed to /apps/com.github.amclin/npm-packager-example/clientlibs
Running AEM Packager for com.github.amclin.npm-packager-example
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.github.amclin:npm-packager-example:content-package:1.0.0
[WARNING] 'groupId' contains an expression but should be a constant. @ ${npmgroupId}:${npmartifactId}:${npmversion}, /Users/amclin/git/aem-packager/src/pom.xml, line 10, column 11
[WARNING] 'artifactId' contains an expression but should be a constant. @ ${npmgroupId}:${npmartifactId}:${npmversion}, /Users/amclin/git/aem-packager/src/pom.xml, line 11, column 14
[WARNING] 'version' contains an expression but should be a constant. @ ${npmgroupId}:${npmartifactId}:${npmversion}, /Users/amclin/git/aem-packager/src/pom.xml, line 12, column 11
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
@amclin amclin added the enhancement New feature or request label Nov 5, 2018
@amclin amclin changed the title Prevent extraneous maven warnings in build log Reduce extraneous maven warnings in build log Nov 5, 2018
@amclin amclin added the help wanted Extra attention is needed label Nov 9, 2018
@amclin amclin modified the milestone: 1.0 Nov 9, 2018
@amclin amclin added techdebt Technical Debt that needs to be improved and removed enhancement New feature or request labels Nov 26, 2018
@amclin
Copy link
Owner Author

amclin commented Nov 9, 2021

For users with Maven 3.2.1 and later, the message specifically for version can be eliminated by replacing ${npmversion} with a property named ${revision}. Several 'allowed' properties have been created, but only for use in the <version> field.

This doesn't solve groupId or artifactId

Alternatively we could temporarily copy the pom.xml and do string replacement instead of using Maven's properties system, but that is such a messy approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed techdebt Technical Debt that needs to be improved
Projects
None yet
Development

No branches or pull requests

1 participant