michael-o commented on code in PR #179: URL: https://github.com/apache/maven-shade-plugin/pull/179#discussion_r1462324017
########## src/it/projects/MSHADE-420/invoker.properties: ########## @@ -0,0 +1,25 @@ +# 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.goals.1 = clean package -DfinalName=current-OS dependency:copy-dependencies + +invoker.mavenOpts.2=-Duser.timezone=UTC Review Comment: Use canonical name `Etc/UTC` ########## src/it/projects/MSHADE-420/verify.groovy: ########## @@ -0,0 +1,59 @@ +/* + * 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.security.MessageDigest +import java.util.jar.JarFile + +String describeEntry(JarFile jar, String name, long time) { + def entry = jar.getEntry(name) + return String.format(" - %-47s: time = ", name) + entry.getTime() + ", lastModified = " + entry.getLastModifiedTime()\ Review Comment: Why don't you use `String#format()` throughout? ########## src/it/projects/MSHADE-420/zipdetails.txt: ########## @@ -0,0 +1,215 @@ +# 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. + +# extract of zipdetails Linux tool output on target/dependency/jna-5.13.0.jar Review Comment: That is not a Linux tool, that is a Perl package: https://perldoc.perl.org/zipdetails ########## src/it/projects/MSHADE-420/verify.groovy: ########## @@ -0,0 +1,59 @@ +/* + * 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.security.MessageDigest +import java.util.jar.JarFile + +String describeEntry(JarFile jar, String name, long time) { + def entry = jar.getEntry(name) + return String.format(" - %-47s: time = ", name) + entry.getTime() + ", lastModified = " + entry.getLastModifiedTime()\ + + " = diff " + (long)((entry.getTime() / 1000L - time)/60L) + " min., extra = " + entry.getExtra() Review Comment: This will just print `byte[]@sdfgas`. Maybe you need a base64 converter here? ########## src/it/projects/MSHADE-420/verify.groovy: ########## @@ -0,0 +1,59 @@ +/* + * 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.security.MessageDigest +import java.util.jar.JarFile + +String describeEntry(JarFile jar, String name, long time) { + def entry = jar.getEntry(name) + return String.format(" - %-47s: time = ", name) + entry.getTime() + ", lastModified = " + entry.getLastModifiedTime()\ + + " = diff " + (long)((entry.getTime() / 1000L - time)/60L) + " min., extra = " + entry.getExtra() +} + +String describeJar(JarFile jar) { + return describeEntry(jar, "com/sun/jna/openbsd-x86-64/libjnidispatch.so", 1671223758L) + '\n'\ + + describeEntry(jar, "com/sun/jna/linux-loongarch64/libjnidispatch.so", 1671223358L) +} + +String describe(String name) { + def file = new File(basedir, "target/" + name) + def jar = new JarFile(file) + + println(name) + return "sha1 = " + MessageDigest.getInstance("SHA1").digest(file.bytes).encodeHex().toString()\ + + "\n" + describeJar(jar) +} + +void describeTz(TimeZone tz) { + println("TZ = " + tz.getID() + ", raw offset = " + tz.getRawOffset() / 60000 + " min., offset to current TZ = " + (tz.getRawOffset() - TimeZone.getDefault().getRawOffset()) / 60000 + " min.") +} + +describeTz(TimeZone.getDefault()) +println(describe("dependency/jna-5.13.0.jar")) +println(describe("current-OS.jar")) +def utcDescription = describe("UTC.jar") +describeTz(TimeZone.getTimeZone("UTC")) Review Comment: Same here -- 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-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org