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

Use HTTPS, not HTTP, for project line URLs #53

Closed
wants to merge 1 commit into from
Closed

Use HTTPS, not HTTP, for project line URLs #53

wants to merge 1 commit into from

Conversation

ctrueden
Copy link

As described in #26, the tidy-maven-plugin currently reverts https: URLs, which are now mandatory, to http: URLs, which cause errors. For example, in Eclipse, with http: URLs, I am seeing:

Multiple markers at this line
- cvc-elt.1.a: Cannot find the declaration of element 'project'.
- schema_reference.4: Failed to read schema document 'bundleentry://260.fwk1924378583/xsd/maven-v4_0_0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

Whereas with HTTPS, all is well (apart from a nonfatal warning "No grammar constraints (DTD or XML Schema)").

This PR replaces the behavior with https: URLs in the project tag always.

ctrueden added a commit to scijava/pom-scijava-base that referenced this pull request Feb 17, 2022
Otherwise, Eclipse now yields errors like:

  Multiple markers at this line
  - cvc-elt.1.a: Cannot find the declaration of element 'project'.
  - schema_reference.4: Failed to read schema document 'bundleentry://260.fwk1924378583/xsd/maven-v4_0_0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

Unfortunately, the tidy-maven-plugin 1.1.0 reverts this change;
I filed mojohaus/tidy-maven-plugin#53 to correct the issue.
Copy link
Member

@slachiewicz slachiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespace must be http, location should be https

@ctrueden
Copy link
Author

ctrueden commented Feb 17, 2022

@slachiewicz OK, so like this?

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

I confirm that with the above line, Eclipse is happy, and the maven-release-plugin still works. Whereas with all HTTPS, maven-release plugin throws the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare (default-cli) on project script-editor: Execution default-cli of goal org.apache.maven.plugins:maven-release-plugin:2.5.3:prepare failed: The namespace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" could not be added as a namespace to "project": The namespace prefix "xsi" collides with an additional namespace declared by the element -> [Help 1]
[ERROR]

@ctrueden
Copy link
Author

After amending my commit to change only the schema location, I see that the tidy-maven-plugin already uses HTTPS for that. So this PR is unnecessary. Sorry for the noise.

@ctrueden ctrueden closed this Feb 17, 2022
@ctrueden ctrueden deleted the https-project-line branch February 17, 2022 18:10
ctrueden added a commit to scijava/pom-scijava-base that referenced this pull request Feb 17, 2022
Apparently, it does not work to write https: for the namespace,
only for the actual schema location. Sigh.

See mojohaus/tidy-maven-plugin#53.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants