calgacus / TlkEdit-EE

A file editor for neverwinter-nights game files such as .2da, .uti and .tlk file types.
GNU General Public License v3.0
14 stars 2 forks source link

cannot compile maven project #4

Closed calgacus closed 5 years ago

calgacus commented 5 years ago

I try mvn compile and get this error:

[ERROR] Failed to execute goal on project TlkEdit-EE: Could not resolve dependencies for project tlkedit:TlkEdit-EE:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: tlkedit:swingx:jar:unknown, tlkedit:jmyspell:jar:1.0.0-beta1: Failure to find tlkedit:swingx:jar:unknown in file://C:\Users\me\Dev\TlkEdit-EE/lib was cached in the local repository, resolution will not be reattempted until the update interval of local-jars has elapsed or updates are forced -> [Help 1]

Mingun commented 5 years ago

It seems that you must manually add artefact from the local repository to order maven can find it.

You need to execute following two commands in project root to install artefacts:

mvn install:install-file -Dfile=jmyspell-1.0.0-beta1.jar -DgroupId=tlkedit -DartifactId=jmyspell -Dversion=1.0.0-beta1 -Dpackaging=jar -DlocalRepositoryPath=./lib
mvn install:install-file -Dfile=swingx.jar -DgroupId=tlkedit -DartifactId=swingx -Dversion=1.0 -Dpackaging=jar -DlocalRepositoryPath=./lib

It is necessary to think how it can be automated. Meanwhile it is necessary to add this information to readme.

calgacus commented 5 years ago

At first the mvn install commands above did not work so I moved the 2 jar files from lib to the project root. Then the mvn install commands worked but I still got a dependency error : [ERROR] Failed to execute goal on project TlkEdit-EE: Could not resolve dependencies for project tlkedit:TlkEdit-EE:jar:1.0-SNAPSHOT: Could not find artifact tlkedit:swingx:jar:unknown in local-jars (file://C:\Users\me\Dev\TlkEdit-EE/lib) -> [Help 1] when I tried to compile. I then removed the lib/swingx.jar ./ line from pom.xml and then the compile worked. However, when I run the app it crashes with this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/jdesktop/swingx/JXFrame
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.jl.nwn.editor.EditorServer.main(EditorServer.java:67)
Caused by: java.lang.ClassNotFoundException: org.jdesktop.swingx.JXFrame
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 13 more

Also the script created the folder "1.0" under lib/swingx and put the swingx.jar file in there so it should be able to find it.

Are you still using the tlkedit.sh file to run the app after compiling and packaging with maven? Do you have a different Classpath set up or some other setup I may be missing?

Mingun commented 5 years ago

Just checked and write correct instruction in PR #6