-
Notifications
You must be signed in to change notification settings - Fork 27
Deprecate HTML4-error-reporting methods/classes and update pom.xml for the 1.5 release #22
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
base: release-1.5
Are you sure you want to change the base?
Changes from all commits
dc10ae9
2d78654
e609391
bd686c6
ed17453
a817dec
d23c88f
2bab502
2b3dc35
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
<groupId>nu.validator.htmlparser</groupId> | ||
<artifactId>htmlparser</artifactId> | ||
<packaging>bundle</packaging> | ||
<version>1.4</version> | ||
<version>1.5</version> | ||
<name>htmlparser</name> | ||
<url>http://about.validator.nu/htmlparser/</url> | ||
<description>The Validator.nu HTML Parser is an implementation of the HTML5 parsing algorithm in Java for applications. The parser is designed to work as a drop-in replacement for the XML parser in applications that already support XHTML 1.x content with an XML parser and use SAX, DOM or XOM to interface with the parser.</description> | ||
|
@@ -69,8 +69,8 @@ | |
</license> | ||
</licenses> | ||
<scm> | ||
<connection>scm:hg:http://hg.mozilla.org/projects/htmlparser/</connection> | ||
<url>http://hg.mozilla.org/projects/htmlparser/</url> | ||
<connection>scm:git:https://github.com/validator/htmlparser.git</connection> | ||
<url>https://github.com/validator/htmlparser</url> | ||
</scm> | ||
<build> | ||
<sourceDirectory>${project.build.directory}/src</sourceDirectory> | ||
|
@@ -80,22 +80,13 @@ | |
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.5</source> | ||
<target>1.5</target> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<version>1.7</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.sun</groupId> | ||
<artifactId>tools</artifactId> | ||
<version>1.5.0</version> | ||
<scope>system</scope> | ||
<systemPath>${java.home}/../lib/tools.jar</systemPath> | ||
</dependency> | ||
</dependencies> | ||
<executions> | ||
<execution> | ||
<id>intitialize-sources</id> | ||
|
@@ -121,6 +112,7 @@ | |
</goals> | ||
<configuration> | ||
<target> | ||
<property name="build.compiler" value="extJavac"/> | ||
<property name="translator.sources" value="${basedir}/translator-src"/> | ||
<property name="translator.classes" value="${project.build.directory}/translator-classes"/> | ||
<mkdir dir="${translator.classes}"/> | ||
|
@@ -157,7 +149,8 @@ | |
<Bundle-Name>${project.name}</Bundle-Name> | ||
<Bundle-SymbolicName>nu.validator.htmlparser</Bundle-SymbolicName> | ||
<Bundle-Version>${project.version}</Bundle-Version> | ||
<Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment> | ||
<Bundle-RequiredExecutionEnvironment>JavaSE-1.7</Bundle-RequiredExecutionEnvironment> | ||
<Automatic-Module-Name>nu.validator.htmlparser</Automatic-Module-Name> | ||
<_removeheaders>Built-By,Bnd-LastModified</_removeheaders> | ||
</instructions> | ||
</configuration> | ||
|
@@ -214,7 +207,7 @@ | |
<dependency> | ||
<groupId>xom</groupId> | ||
<artifactId>xom</artifactId> | ||
<version>1.1</version> | ||
<version>[1.3.5,)</version> | ||
Comment on lines
-217
to
+210
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As explained in #17 (comment), I believe this should be reverted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with the dependency upgrade (see #26) However, I hold that the use of version ranges should be reverted, as it's not a common Maven practice. See here for a typical Maven example. As already mentioned here, I believe fixed versions should be used, among other things "for the sake of build reproducibility and stability". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It is perfectly common and I use them after feedback from my downstream users, which may not always get the versions that they want if I do not do that. In fact, in the "typical Maven example" that you link, they say:
So they use these exact dependencies as the result of an upstream decision. I do not have a strong opinion against using single versions, but the version ranges are self-explanatory about the supported versions and (my) downstream users prefer that.
Maven builds are not reproducible unless you use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, "common" was a bad choice of words. Let me state it differently: I very rarely, if ever, come across Maven POMs that use version ranges for dependencies. From a quick look at some of the most popular Java libraries/frameworks on GitHub that use Maven, I don't find any that use version ranges for dependencies: Maven itself, Guava, Byte Buddy, Spring Data JPA, Hibernate Validator, commons-lang, Quarkus, Helidon, ... (same holds for a few Gradle projects I looked at, such as Spring Framework) Guava has nearly 197000 dependents. Now I don't know how many of those use Maven, but if the lack of version ranges would really pose a problem for downstream consumers, I'm pretty sure Guava would be using them by now. By using fixed versions, you always know for each commit which version was used for each dependency: so if it built 2 years ago, it'll still build now. And if 2 developers clone the repo and build any given commit, they're always going to have equivalent results w.r.t. dependencies. And w.r.t. downstream users: say 2 years ago As for detecting compatibility issues with new versions of dependencies: I agree that it's better to detect this sooner rather than later, but I believe there are better ways to do so. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I was told otherwise by a former Maven developer, although perhaps there was a misunderstanding. And very large projects are much less likely to use dependency ranges. Maven dependency version resolution is supposed to be somewhat flexible, and I'm not sure under which circumstances the problem would happen, but I was told that the safe approach (in a complex environment where fixed versions of the same dependency were specified by multiple libraries) was to configure exclusions. That may affect very big projects only though, and I haven't really seen a detailed account of it.
A dependency range does not give less information than a fixed one. If you know that the minimum version is
And such a resolution problem would affect the upstream developer, not downstream. If a beta is not compatible, that's a bug that you may have to file.
In css4j I have detected some important upstream issues by this method. BTW this requires a significant amount of tests that are able to detect such problems (about 45% of the css4j code is test-related).
That's the other part of the issue: in my opinion, users have the right expectation that a supported project is going to run with reasonably recent dependencies, and if that is not the case they sometimes may file a bug with the dependency, sometimes with you. I have had a few of those, and have to deal with that as a maintainer. This project can choose to depend on a fixed version (and some people are going to understand that the library is endorsing that version, or can only work with it), or specify a range (and other people are going to have ridiculous expectations about what that means, as you mention). The range could be more conservative than what I suggested: for example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I finally found out what was going on with the fixed dependencies; it appears that for downstream users, setting this:
is effectively the same as:
which is not what I read in: https://maven.apache.org/pom.html#dependency-version-requirement-specification " nor in: "Maven picks the "nearest definition". That is, it uses the version of the closest dependency to your project in the tree of dependencies. You can always guarantee a version by declaring it explicitly in your project's POM. Note that if two dependency versions are at the same depth in the dependency tree, the first declaration wins." Nope, the real behaviour is described here: https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#CJHDEHAB " That is, Oracle recommends using version ranges... More from that page: "When Maven encounters multiple matches for a version reference, it uses the highest matching version. Generally, version references should be only as specific as required so that Maven is free to choose a new version of dependencies where appropriate" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Marbaise says on the same page:
I hope we can agree that (a) this is not the point of view you're defending here, and (b) given Marbaise's Maven expertise, it's much more likely that his view is in line with best practices.
I rest my case. It is beyond me why we're still having this discussion, if it's impossible to readily give me a list of projects that use version ranges and are at least somewhat popular. And just to give some verifiable counterexamples w.r.t. application servers: from a quick look, neither WildFly nor Payara use version ranges.
Which, as mentioned above, is not Marbaise's point of view. And "are highly proficient" is an unverifiable opinion, whereas it's trivial to verify that Marbaise is a Maven expert.
I'd say this speaks for itself. With that being said, I'm out for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Well, that was before I read your latest comment. Honestly, I'm mindblown by your ability to select and interpret information in such a way that it matches your beliefs. That page is about Maven in the context of Oracle Fusion Middleware. And yes, in that context, it's reasonable to declare a dependency as Also note that this is about the use of version ranges in middleware applications, not libraries. As for the first part of your comment: if you believe it presents a valid point, please describe a concrete example (like: "A has a dependency on B, and B has a dependency on C. If A's So let me try that again: with that being said, I'm out for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mr. @anthonyvdotbe is "out" (and hopefully won't come back) and I'm tired of this thread as well, but if anyone wants to know about how those build failures (in complex projects) happen, there is an informative blog post here: My downstream project's build error was of the kind described there, and version ranges are an easy solution to the problem. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To summarize the thread so far: Given the following dependency graph:
Then when
However, when enabling this rule from the Now @carlosame holds that |
||
<scope>compile</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in #17 (comment), I believe this should be reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this, no need to revert (see #26)