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

ICU-22324 Add docs for Maven usage #2655

Merged
merged 1 commit into from Oct 5, 2023
Merged

Conversation

echeran
Copy link
Contributor

@echeran echeran commented Oct 3, 2023

I did a manual run of the "Deploy User Guide" workflow in my personal fork so that you can preview the effects of the changes.

Checklist
  • Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-22324
  • Required: The PR title must be prefixed with a JIRA Issue number.
  • Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
  • Required: Each commit message must be prefixed with a JIRA Issue number.
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • docs/devsetup/java/maven.md is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

markusicu
markusicu previously approved these changes Oct 4, 2023
Copy link
Member

@markusicu markusicu left a comment

Choose a reason for hiding this comment

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

lgtm tnx!

I did not read every word...

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • docs/devsetup/java/maven.md is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

markusicu
markusicu previously approved these changes Oct 4, 2023
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>68.1</version>
Copy link
Contributor

@mihnita mihnita Oct 5, 2023

Choose a reason for hiding this comment

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

Nitpick: newer version? (74.1, or at least 73.2 ?)

If 68.1 is already used in other places then either change all, or keep 68.1 here and do an update later (your call)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack. I'm okay with an old version. We shouldn't feel the need to update this during a new version release's BRS tasks. If it's not old now, it will become so after the next version.

Any resource files (non-source files) will be located at `src/main/resources`.


| Sub-component Path | Sub-component Name | Build Dependencies | Public API Packages | Description |
Copy link
Contributor

@mihnita mihnita Oct 5, 2023

Choose a reason for hiding this comment

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

I wonder if it is worth listing this.
Or at least the dependency, and component names columns.

These are things that can be easily obtained with maven:

mvn dependency:tree

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I included that to be consistent with the Ant-based docs we have for ICU 73 and earlier. The same argument could have been made there ("just look at the build.xml file to find component deps").

Personally, I think documentation about a codebase is something that I find useful and would like to see more of, even though it is rare. But I do believe it to be a different type of doc than inline source comments, API docs, design/architecture docs, and tutorials.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but documentation about code base also gets outdated very fast :-)

For the Ant dependencies you had to grep, then "massage" things yourself.
Maven has a standard way to do it.

What about keep the table, but remove the "Dependencies" column, and say "for an up to date dependency report run mvn dependency:tree"?
The result is more readable than this table (for example you can see if something is a test dependency or not)

</tr>
<tr>
<td><code>main/shared</code></td>
<td>(Obsolete?) Files shared by ICU4J sub-components under the <code>main</code> directory including: <ul> <li>ICU4J runtime data archive (icudata.jar).</li> <li>ICU4J unit test data archive (testdata.jar).</li> <li>Shared Ant build script and configuration files.</li> <li>License files.</li></ul> </td>
Copy link
Contributor

Choose a reason for hiding this comment

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

+10
Obsolete, can remove the whole line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

</tr>
</table>

## The Structure and Contents of ICU4J - ICU 73 and earlier
Copy link
Contributor

Choose a reason for hiding this comment

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

Idea: split in a different file, to reduce the clutter?
And with only a link from here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Markus wanted to keep the Ant instructions for people who might still be using a version of ICU4J that is a few versions old. There will be a non-trivial number of people.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I didn't say remove.
Only split into a different file with a link.

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep it here for now, at least for expediency.

Once the JDK and Maven are installed, run the desired Maven target. For example:

~~~
~/icu/icu4j$ mvn test
Copy link
Contributor

Choose a reason for hiding this comment

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

mvn verify
?
Let's not encourage people to skip the integration tests :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@mihnita mihnita left a comment

Choose a reason for hiding this comment

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

Added a few comments.

Copy link
Contributor

@mihnita mihnita left a comment

Choose a reason for hiding this comment

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

Updated.
And sorry, I realized I missed maven.md. Will do.

---


Maven is a pretty standard build tool in the Java ecosystem with a very well-defined
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: remove "pretty" :-) After 20+ years it is standard :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

## Installation

Install Maven from your OS package manager.
The minimum version is 3.2.5, as configured in the `<ICU>/icu4j/pom.xml` root POM file's maven-enforcer-plugin.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want this level of detail?
This is the kind of stuff that gets outdated sooner or later.


Link to https://books.sonatype.com/mvnex-book/reference/installation.html ?

In general I would make this doc smaller and link to the relevant sections of "Maven by Example" or "Maven: The Complete Reference" as needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@mihnita mihnita left a comment

Choose a reason for hiding this comment

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

Thank you.

Added a few comments, nitpicks.
If you like (some) of them, don't be reluctant to implement them.
I will re-approve in a minute.


## Usage at the command line

Maven divides its concept of a build into a "lifecycle" of a linear sequence of steps, called "phases".
Copy link
Contributor

Choose a reason for hiding this comment

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


where `<projectlist>` is a comma-separated list of names of the subfolders which contain the submodule configuration pom.xml files.

If you want to run only a specific test(s), use the `-Dtest="<test>"` option, where `<test>` can be a test name, a class name / package prefix, or a comma-separate list of them.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe drop this paragraph, since you have a whole "Run a single test" section?

mvn integration-test -am -pl main/core
```

#### Run a single test
Copy link
Contributor

Choose a reason for hiding this comment

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

## More info on Maven

To learn more about the details of Maven not covered above,
start by reading the [*Maven by Example* book](https://books.sonatype.com/mvnex-book/reference/index.html),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick / personal pref: "book" outside the link.

@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@echeran echeran merged commit 2e9d128 into unicode-org:main Oct 5, 2023
99 checks passed
@echeran echeran deleted the maven-docs branch October 5, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants