Updated Java to 21 and pom.xml to shade

This commit is contained in:
lkrsnik 2024-03-19 09:40:46 +01:00
parent edcd8062bc
commit 9bb9c5669d
7 changed files with 96 additions and 93 deletions

2
.gitignore vendored
View File

@ -164,3 +164,5 @@ $RECYCLE.BIN/
src/main/resources/translation_external/ src/main/resources/translation_external/
src/main/resources/translations_backup/ src/main/resources/translations_backup/
shade
TEMP

130
pom.xml
View File

@ -4,9 +4,30 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>thesis</groupId> <groupId>list</groupId>
<artifactId>corpus-analyzer</artifactId> <artifactId>list</artifactId>
<version>1.2</version> <name>list</name>
<version>1.3</version>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
<repository>
<id>central2</id>
<name>Central Repository2</name>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
<javafx.version>21</javafx.version>
<ikonli.version>12.3.1</ikonli.version>
<javafx.maven.plugin.version>0.0.8</javafx.maven.plugin.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
@ -32,7 +53,7 @@
<dependency> <dependency>
<groupId>org.controlsfx</groupId> <groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId> <artifactId>controlsfx</artifactId>
<version>8.40.13</version> <version>11.2.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.rocksdb</groupId> <groupId>org.rocksdb</groupId>
@ -52,71 +73,82 @@
<dependency> <dependency>
<groupId>org.kordamp.ikonli</groupId> <groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-fontawesome-pack</artifactId> <artifactId>ikonli-fontawesome-pack</artifactId>
<version>1.9.0</version> <version>${ikonli.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version>
<classifier>win</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version>
<classifier>linux</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>${javafx.version}</version>
<classifier>mac</classifier>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.kordamp.ikonli</groupId> <groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId> <artifactId>ikonli-javafx</artifactId>
<version>1.9.0</version> <version>${ikonli.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<!-- packages dependencies into the jar -->
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.maven.plugin.version}</version>
<configuration>
<mainClass>gui.GUIController</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>single</goal> <goal>shade</goal>
</goals> </goals>
<configuration> <configuration>
<archive> <shadedArtifactAttached>true</shadedArtifactAttached>
<manifest> <shadedClassifierName>project-classifier</shadedClassifierName>
<mainClass>gui.GUIController</mainClass> <outputFile>shade\${project.artifactId}.jar</outputFile>
</manifest> <transformers>
</archive> <transformer implementation=
<descriptorRefs> "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<descriptorRef>jar-with-dependencies</descriptorRef> <mainClass>gui.Launcher</mainClass>
</descriptorRefs> </transformer>
<appendAssemblyId>false</appendAssemblyId> </transformers>
<outputDirectory>artifact</outputDirectory>
<finalName>Corpus_Analyzer_${version}</finalName>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<!-- JavaFX -->
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<mainClass>gui.GUIController</mainClass>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<id>create-jfxjar</id>
<phase>package</phase>
<goals>
<goal>build-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project>
</project>

View File

@ -3,11 +3,8 @@ package alg.ngram;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.sun.xml.internal.bind.v2.runtime.reflect.Lister;
import data.*; import data.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;

View File

@ -194,8 +194,6 @@ public class CorpusTab {
} }
public void initialize() { public void initialize() {
updateTooltipBehavior(0.0, 30000.0,0.0, true);
// add CSS style // add CSS style
corpusTabPane.getStylesheets().add("style.css"); corpusTabPane.getStylesheets().add("style.css");
corpusTabPane.getStyleClass().add("root"); corpusTabPane.getStyleClass().add("root");

View File

@ -61,23 +61,13 @@ public final class I18N {
public static String get(final String key, final Object... args) { public static String get(final String key, final Object... args) {
ResourceBundle bundle = ResourceBundle.getBundle("message", getLocale()); ResourceBundle bundle = ResourceBundle.getBundle("message", getLocale());
String val = bundle.getString(key); String val = bundle.getString(key);
try { return MessageFormat.format(val, args);
return MessageFormat.format(new String(val.getBytes("ISO-8859-1"), "UTF-8"), args);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return val;
} }
public static String getDefaultLocaleItem(final String key, final Object... args) { public static String getDefaultLocaleItem(final String key, final Object... args) {
ResourceBundle bundle = ResourceBundle.getBundle("message", getDefaultLocale()); ResourceBundle bundle = ResourceBundle.getBundle("message", getDefaultLocale());
String val = bundle.getString(key); String val = bundle.getString(key);
try { return MessageFormat.format(val, args);
return MessageFormat.format(new String(val.getBytes("ISO-8859-1"), "UTF-8"), args);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return val;
} }
public static ObservableList<String> getObject(final ArrayList<String> keys, final Object... args) { public static ObservableList<String> getObject(final ArrayList<String> keys, final Object... args) {
@ -86,11 +76,7 @@ public final class I18N {
ArrayList<String> results = new ArrayList<>(); ArrayList<String> results = new ArrayList<>();
for(String key : keys){ for(String key : keys){
String val = bundle.getString(key); String val = bundle.getString(key);
try { results.add(val);
results.add(MessageFormat.format(new String(val.getBytes("ISO-8859-1"), "UTF-8"), args));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
} }
return FXCollections.observableArrayList(results); return FXCollections.observableArrayList(results);
@ -121,12 +107,7 @@ public final class I18N {
public static String getIndependent(final String key, Locale locale, final Object... args) { public static String getIndependent(final String key, Locale locale, final Object... args) {
ResourceBundle bundle = ResourceBundle.getBundle("message", locale); ResourceBundle bundle = ResourceBundle.getBundle("message", locale);
String val = bundle.getString(key); String val = bundle.getString(key);
try { return MessageFormat.format(val, args);
return MessageFormat.format(new String(val.getBytes("ISO-8859-1"), "UTF-8"), args);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return val;
} }
public static String getRootValue(String oldValue, ArrayList<String> nGramComputeForLetters) { public static String getRootValue(String oldValue, ArrayList<String> nGramComputeForLetters) {

View File

@ -0,0 +1,8 @@
package gui;
public class Launcher {
public static void main(String[] args) {
GUIController.main(args);
}
}

View File

@ -13,9 +13,7 @@ public class CorpusTests {
@Test @Test
public void solarTest() { public void solarTest() {
// File selectedDirectory = new File("/home/luka/Desktop/corpus-analyzer/src/main/resources/Solar"); File selectedDirectory = new File("/home/luka/Development/CJVT/list/src/main/resources/Gigafida_subset/");
// File selectedDirectory = new File("/home/andrej/Desktop/corpus-analyzer/src/main/resources/GOS");
File selectedDirectory = new File("/home/luka/Development/corpus-analyzer2/src/main/resources/Gigafida_subset/");
Settings.resultsFilePath = new File(selectedDirectory.getAbsolutePath().concat(File.separator)); Settings.resultsFilePath = new File(selectedDirectory.getAbsolutePath().concat(File.separator));
@ -23,20 +21,7 @@ public class CorpusTests {
File f = Settings.corpus.iterator().next(); File f = Settings.corpus.iterator().next();
// Statistics stats = new Statistics(AnalysisLevel.STRING_LEVEL, 2, 0, CalculateFor.WORD);
// // stats.setCorpusType(CorpusType.GOS);
// stats.setCorpusType(CorpusType.SOLAR);
// XML_processing.readXMLGos(f.toString(), stats);
// XML_processing.readXML(f.toString(), stats);
// XML_processing.readXMLHeaderTag(f.toString(), "stats");
} }
// @Test
// public void test() {
// ObservableList<String> var = GosTaxonomy.getForComboBox();
// String debug = "";
//
// }
} }