You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/09/24 13:06:37 UTC
[GitHub] [maven-invoker-plugin] edwardUL99 opened a new pull request, #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
edwardUL99 opened a new pull request, #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146
Following this checklist to help us incorporate your
contribution quickly and easily:
- [X] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MINVOKER) filed
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
- [X] Each commit in the pull request should have a meaningful subject line and body.
- [X] Format the pull request title like `[MINVOKER-XXX] - Fixes bug in ApproximateQuantiles`,
where you replace `MINVOKER-XXX` with the appropriate JIRA issue. Best practice
is to use the JIRA issue title in the pull request title and in the first line of the
commit message.
- [X] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [X] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
- [X] You have run the integration tests successfully (`mvn -Prun-its clean verify`).
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [X] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [X] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
A new parameter **updateSnapshots** has been added to AbstractInvokerMojo which is passed into the shared invoker's InvocationRequest object before being passed into invoker.execute. It can also read the property from invoker.properties file property invoker.updateSnapshots
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979285146
##########
src/it/MINVOKER-289/verify.bsh:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+ // make sure the Invoker Plugin was indeed run and the build didn't fail somewhere else
+ File touchFile = new File( basedir, "target/it/project/touch.txt" );
+ System.out.println( "Checking for existence of touch file: " + touchFile );
+ if ( !touchFile.exists() )
+ {
+ System.out.println( "FAILED!" );
+ return false;
+ }
+
+ File buildLog = new File( basedir, "build.log" );
+ try
+ {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(buildLog)));
+ StringBuilder builder = new StringBuilder();
+ String line;
+
+ while ( ( line = reader.readLine() ) != null )
+ {
+ builder.append( line ). append ( "\n" );
+ }
+
+ reader.close();
+
+ String out = builder.toString();
+
+ if ( !out.contains( "[DEBUG] (f) updateSnapshots = true" ) )
Review Comment:
Is that possible? I don't see any mention of snapshots being updated in the build.log other than the deub message with updateSnapshots. Unless that is an indication the fix isn't working
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979261121
##########
src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java:
##########
@@ -677,6 +677,9 @@
@Parameter( defaultValue = "false", property = "invoker.updateOnly" )
private boolean updateOnly = false;
+ @Parameter( defaultValue = "false", property = "invoker.updateSnapshots" )
+ private boolean updateSnapshots = false;
+
Review Comment:
Sure, will do. Is it a javadoc required
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979285146
##########
src/it/MINVOKER-289/verify.bsh:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+ // make sure the Invoker Plugin was indeed run and the build didn't fail somewhere else
+ File touchFile = new File( basedir, "target/it/project/touch.txt" );
+ System.out.println( "Checking for existence of touch file: " + touchFile );
+ if ( !touchFile.exists() )
+ {
+ System.out.println( "FAILED!" );
+ return false;
+ }
+
+ File buildLog = new File( basedir, "build.log" );
+ try
+ {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(buildLog)));
+ StringBuilder builder = new StringBuilder();
+ String line;
+
+ while ( ( line = reader.readLine() ) != null )
+ {
+ builder.append( line ). append ( "\n" );
+ }
+
+ reader.close();
+
+ String out = builder.toString();
+
+ if ( !out.contains( "[DEBUG] (f) updateSnapshots = true" ) )
Review Comment:
Is that possible? I don't see any mention of snapshots being updated in the build.log. Unless that is an indication the fix isn't working
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] slawekjaranowski commented on pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#issuecomment-1257286221
```
surefire-junit4/2.12.4/surefire-junit4-2.12.4.pom.part (No such file or directory)
```
probably network problems - I will re-run build
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979261121
##########
src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java:
##########
@@ -677,6 +677,9 @@
@Parameter( defaultValue = "false", property = "invoker.updateOnly" )
private boolean updateOnly = false;
+ @Parameter( defaultValue = "false", property = "invoker.updateSnapshots" )
+ private boolean updateSnapshots = false;
+
Review Comment:
Sure, will do. Is it a javadoc required or are there other documentation updates needed? Could you clarify on documentation for `invoker.properties`? Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979274206
##########
src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java:
##########
@@ -677,6 +682,12 @@
@Parameter( defaultValue = "false", property = "invoker.updateOnly" )
private boolean updateOnly = false;
+ /**
+ * Force a check for missing releases and updated snapshots on remote repositories. This is passed to the invoked
+ * maven projects (it is the same as if you were to use the -U, --update-snapshots flag on the command line).
+ *
+ * @since 3.3.1
+ */
Review Comment:
@slawekjaranowski Documentation added as requested (also added to the invoker.properties documentation). Please verify if it is correct, if not I will update it. Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] slawekjaranowski commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979283317
##########
src/it/MINVOKER-289/verify.bsh:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+ // make sure the Invoker Plugin was indeed run and the build didn't fail somewhere else
+ File touchFile = new File( basedir, "target/it/project/touch.txt" );
+ System.out.println( "Checking for existence of touch file: " + touchFile );
+ if ( !touchFile.exists() )
+ {
+ System.out.println( "FAILED!" );
+ return false;
+ }
+
+ File buildLog = new File( basedir, "build.log" );
+ try
+ {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(buildLog)));
+ StringBuilder builder = new StringBuilder();
+ String line;
+
+ while ( ( line = reader.readLine() ) != null )
+ {
+ builder.append( line ). append ( "\n" );
+ }
+
+ reader.close();
+
+ String out = builder.toString();
+
+ if ( !out.contains( "[DEBUG] (f) updateSnapshots = true" ) )
Review Comment:
We will be sure that maven-invoker-plugin was configured correctly ...
We also should check somehow if Maven process was called with expected options.
##########
src/it/MINVOKER-289/invoker.properties:
##########
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.updateSnapshots = true
Review Comment:
This file is not needed - we have the same in configuration
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979285146
##########
src/it/MINVOKER-289/verify.bsh:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+ // make sure the Invoker Plugin was indeed run and the build didn't fail somewhere else
+ File touchFile = new File( basedir, "target/it/project/touch.txt" );
+ System.out.println( "Checking for existence of touch file: " + touchFile );
+ if ( !touchFile.exists() )
+ {
+ System.out.println( "FAILED!" );
+ return false;
+ }
+
+ File buildLog = new File( basedir, "build.log" );
+ try
+ {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(buildLog)));
+ StringBuilder builder = new StringBuilder();
+ String line;
+
+ while ( ( line = reader.readLine() ) != null )
+ {
+ builder.append( line ). append ( "\n" );
+ }
+
+ reader.close();
+
+ String out = builder.toString();
+
+ if ( !out.contains( "[DEBUG] (f) updateSnapshots = true" ) )
Review Comment:
Is that possible? I don't see any mention of snapshots being updated in the build.log other than the debug message with updateSnapshots. Unless that is an indication the fix isn't working
**Update**: I found the line
```
[DEBUG] Executing: /bin/sh -c cd '/home/eddy/Coding/maven-contrib/maven-invoker-plugin/target/it/MINVOKER-289/target/it/project' && '/usr/share/maven/bin/mvn' '-B' '-U' '-X' '-D' 'maven.repo.local=/home/eddy/Coding/maven-contrib/maven-invoker-plugin/target/local-repo' '-s' '/home/eddy/Coding/maven-contrib/maven-invoker-plugin/target/invoker-settings17028254143205328565.xml' 'validate'
```
I will add a verification top check that the correct args are passed. Thanks for your review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#issuecomment-1257285205
Checks related to an issue with dependency surefire junit is causing mac jdk-8 verify action to fail. The error is as follows:
```
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.surefire:surefire-junit4:pom:2.12.4 from/to central (https://repo.maven.apache.org/maven2): /Users/runner/work/maven-invoker-plugin/maven-invoker-plugin/target/local-repo/org/apache/maven/surefire/surefire-junit4/2.12.4/surefire-junit4-2.12.4.pom.part (No such file or directory)
```
```
[INFO] Passed: 1, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for MINVOKER-191-parent 1.0-SNAPSHOT:
[INFO]
[INFO] MINVOKER-191-parent ................................ SUCCESS [ 0.003 s]
[INFO] MINVOKER-191-java-a ................................ SUCCESS [ 8.893 s]
[INFO] MINVOKER-191-plugin ................................ SUCCESS [ 9.831 s]
[INFO] MINVOKER-191-java-b ................................ FAILURE [ 4.251 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.940 s (Wall Clock)
[INFO] Finished at: 2022-09-25T21:00:30Z
[INFO] ------------------------------------------------------------------------
```
Unsure if it is an intermittent problem, or a problem with the code I checked in
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979294867
##########
src/it/MINVOKER-289/verify.bsh:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+ // make sure the Invoker Plugin was indeed run and the build didn't fail somewhere else
+ File touchFile = new File( basedir, "target/it/project/touch.txt" );
+ System.out.println( "Checking for existence of touch file: " + touchFile );
+ if ( !touchFile.exists() )
+ {
+ System.out.println( "FAILED!" );
+ return false;
+ }
+
+ File buildLog = new File( basedir, "build.log" );
+ try
+ {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(buildLog)));
+ StringBuilder builder = new StringBuilder();
+ String line;
+
+ while ( ( line = reader.readLine() ) != null )
+ {
+ builder.append( line ). append ( "\n" );
+ }
+
+ reader.close();
+
+ String out = builder.toString();
+
+ if ( !out.contains( "[DEBUG] (f) updateSnapshots = true" ) )
Review Comment:
@slawekjaranowski I added a check for the -U flag in the integration test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979285146
##########
src/it/MINVOKER-289/verify.bsh:
##########
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+ // make sure the Invoker Plugin was indeed run and the build didn't fail somewhere else
+ File touchFile = new File( basedir, "target/it/project/touch.txt" );
+ System.out.println( "Checking for existence of touch file: " + touchFile );
+ if ( !touchFile.exists() )
+ {
+ System.out.println( "FAILED!" );
+ return false;
+ }
+
+ File buildLog = new File( basedir, "build.log" );
+ try
+ {
+ BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(buildLog)));
+ StringBuilder builder = new StringBuilder();
+ String line;
+
+ while ( ( line = reader.readLine() ) != null )
+ {
+ builder.append( line ). append ( "\n" );
+ }
+
+ reader.close();
+
+ String out = builder.toString();
+
+ if ( !out.contains( "[DEBUG] (f) updateSnapshots = true" ) )
Review Comment:
Is that possible? I don't see any mention of snapshots being updated in the build.log other than the debug message with updateSnapshots. Unless that is an indication the fix isn't working
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979261121
##########
src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java:
##########
@@ -677,6 +677,9 @@
@Parameter( defaultValue = "false", property = "invoker.updateOnly" )
private boolean updateOnly = false;
+ @Parameter( defaultValue = "false", property = "invoker.updateSnapshots" )
+ private boolean updateSnapshots = false;
+
Review Comment:
Sure, will do
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979261121
##########
src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java:
##########
@@ -677,6 +677,9 @@
@Parameter( defaultValue = "false", property = "invoker.updateOnly" )
private boolean updateOnly = false;
+ @Parameter( defaultValue = "false", property = "invoker.updateSnapshots" )
+ private boolean updateSnapshots = false;
+
Review Comment:
Sure, will do
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] slawekjaranowski merged pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
slawekjaranowski merged PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] slawekjaranowski commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
slawekjaranowski commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979259608
##########
src/main/java/org/apache/maven/plugins/invoker/AbstractInvokerMojo.java:
##########
@@ -677,6 +677,9 @@
@Parameter( defaultValue = "false", property = "invoker.updateOnly" )
private boolean updateOnly = false;
+ @Parameter( defaultValue = "false", property = "invoker.updateSnapshots" )
+ private boolean updateSnapshots = false;
+
Review Comment:
Please add documentations. Also for `invoker.properties`
##########
src/main/java/org/apache/maven/plugins/invoker/InvokerProperties.java:
##########
@@ -476,6 +487,10 @@ public void configureInvocation( InvocationRequest request, int index )
.map( Integer::parseInt )
.orElse( defaultTimeoutInSeconds ) );
+ setIfNotNull( request::setUpdateSnapshots, get( InvocationProperty.UPDATE_SNAPSHOTS, index )
+ .map( Boolean::parseBoolean )
+ .orElse( defaultUpdateSnapshots ) );
+
Review Comment:
unit test will be appreciated, there are tests for other properties
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979261134
##########
src/main/java/org/apache/maven/plugins/invoker/InvokerProperties.java:
##########
@@ -476,6 +487,10 @@ public void configureInvocation( InvocationRequest request, int index )
.map( Integer::parseInt )
.orElse( defaultTimeoutInSeconds ) );
+ setIfNotNull( request::setUpdateSnapshots, get( InvocationProperty.UPDATE_SNAPSHOTS, index )
+ .map( Boolean::parseBoolean )
+ .orElse( defaultUpdateSnapshots ) );
+
Review Comment:
I'll add some tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-invoker-plugin] edwardUL99 commented on a diff in pull request #146: [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag
Posted by GitBox <gi...@apache.org>.
edwardUL99 commented on code in PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#discussion_r979454233
##########
src/it/MINVOKER-289/verify.groovy:
##########
@@ -0,0 +1,36 @@
+import java.lang.reflect.Array
+import java.util.stream.Collectors
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+assert new File( basedir, 'target/it/project/touch.txt' )
+
+File buildLog = new File( basedir, 'build.log' )
+
+String executionString = "Executing:"
+int mavenCommandIndex = buildLog.text.indexOf( executionString )
+String commandLine = buildLog.text.substring( mavenCommandIndex, buildLog.text.indexOf( System.lineSeparator(),
+ mavenCommandIndex ) )
+commandLine = commandLine.substring(commandLine.indexOf("mvn"));
Review Comment:
Previous implementation of this check caused the windows github action build to fail. Made the check platform independent so it correctly checks for the -U flag on windows, linux or Mac
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [MINVOKER-289] - Support for shared invoker's Update-Snapshots Flag [maven-invoker-plugin]
Posted by "jira-importer (via GitHub)" <gi...@apache.org>.
jira-importer commented on PR #146:
URL: https://github.com/apache/maven-invoker-plugin/pull/146#issuecomment-2957820509
Resolve #533
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org