Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/main/java/org/apache/maven/site/update/Update.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@
* https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven-dist-tool/job/master/site/dist-tool-check-errors.html
*/
public class Update {
public static void main(String[] args) {
Update updater = new Update(); // reuse instance
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this works. The value of the retired field might be different in a reused object. I'm not fully sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

If one instance can be reused, then this should all just be static methods, no instances at all. @hboutemy

for (String dir : args) {
Path indexPath = Paths.get("content/apt/" + dir + "/index.apt");
try {
updater.doUpdate(indexPath);
System.out.print("\r\33[2K"); // clear line
} catch (IOException e) {
System.err.println("Failed to update: " + indexPath);
e.printStackTrace();

private boolean retired = false;

public static void main(String[] args) throws IOException {
Expand All @@ -44,6 +55,7 @@ public static void main(String[] args) throws IOException {
System.out.println("\r\33[2K");
}
}
}

private void doUpdate(Path index) throws IOException {
System.out.println("updating " + index);
Expand Down