not able to import abeel util in a maven project

2019-09-04 12:14发布

问题:

I am going a project in maven and using Java-ML in it. While using this library i got error java.lang.ClassNotFoundException: be.abeel.util.GZIPPrintWriter

Now for removing this error, i am trying to import the missing class by import be.abeel.util.GZIPPrintWriter;

but the import statement is not working as i am not able to find the repository of the Abeel Javakit Tool (AJT) to write in the pom.xml to resolve the dependency.

How to resolve this dependency in maven. Please help.

Thanks in advance.

回答1:

It might not have been deployed to Maven Central or another Maven Repository.

In this case you can do the following:

  • Add the JAR to your corporate Maven Repository (see here for Nexus: http://blog.sonatype.com/people/2008/11/adding-a-jar-to-a-maven-repository-with-sonatype-nexus/)

  • Try to get the JAR deployed to Maven Central:

    1. Ask the project owner to deploy the JAR to Maven Central. Here is the documenation how the project owner can do this: https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-9.StageaRelease

    2. If the project owner does not respond but the license is compatible with Maven Central requirements: https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+The+Central+Repository



回答2:

You should import all the recommended libraries list below:

Required libraries: - Apache Commons Math: used in some algorithms, version 1.2 is included Apache Commons Math is distributed under Apache License 2.0 http://commons.apache.org/math/

  • Abeel Java Toolkit: used in some classes, version 1.20 is included AJT is distributed under GNU GPL 2 or later http://sourceforge.net/projects/ajt/

  • Jama: used in some algorithms, version 1.0.2 is included Jama is distributed as public domain software



回答3:

I stumbled into the very same problem, and I did not want to do anything complicated.

That's when I realized that, in the javaml download, we have the following hierarchy: javaml-0.1.7 > lib > ajt-2.9.jar

So I just added, in my app/build.gradle, in the dependencies: compile fileTree(include: ['*.jar'], dir: 'libs/javaml-0.1.7/lib'). Worked like a charm. I can now go to sleep.

(note: I put my javaml folder in a custom libs/ folder, adapt the dir path to your needs)



回答4:

I used javaml-0.1.7.jar faced with the exact problem in my maven project. It easily get fixed when i added ajt-2.9.jar from this repo.