Я использую эту функцию:
public static int[][] copy(final int[][] array) {
if (array != null) {
final int[][] copy = new int[array.length][];
for (int i = 0; i < array.length; i++) {
final int[] row = array[i];
copy[i] = new int[row.length];
System.arraycopy(row, 0, copy[i], 0, row.length);
}
return copy;
}
return null;
}
Большим преимуществом этого подхода является то, что он также может копировать массивы, которые не имеют одинакового количества строк, например:
final int[][] array = new int[][] { { 5, 3, 6 }, { 1 } };
Проблема ЗНАТОКА состоит в том, что ее попытка включать первый файл MANIFEST.MF из первой библиотеки от зависимостей вместо НАШЕГО СОБСТВЕННОГО MANIFEST.MF ПРИ ИСПОЛЬЗОВАНИИ АРТЕФАКТОВ! .
ИЛИ!
Простой создают Вас, владеют MANIFEST.MF и:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<archive>
<manifestFile>/src/main/resources/META-INF/MANIFEST.MF</manifestFile>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
, Но если Вы используете панель знатока (или командная строка знатока) можно вынудить ее генерировать собственную декларацию и включать ее в файл JAR.
Добавляют к Вам pom.xml этот код:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<mode>development</mode>
<url>${project.url}</url>
<key>value</key>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<index>true</index>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<mode>development</mode>
<url>${project.url}</url>
<key>value</key>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>