JMathPlot what is the Maven dependency code please - java

Does anyone know the Maven dependency code for JMathPlot for eclipse
<dependency>
<groupId>jmathplot</groupId>
<artifactId>jmathplot</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jmathplot.jar</systemPath>
</dependency>
Error is it can't find jmathplot/jmathplot/1.0
EDIT1:
OK I put the jar file in folder
C:/Users/MyName/Eclipse/Workspace1/MyProjectName/
Next to src, target,assembly folders
I changed dependency to:
<dependency>
<groupId>jmathplot</groupId>
<artifactId>jmathplot</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/jmathplot.jar</systemPath>
</dependency>
And I get the error:
com.tradable.terminal!.plugin.storage.Tr!PluginPackageException: PluginId: com.NoviumResearch.ValueAtRisk, The resource lib/jmathplot.jar does not exist
It seems to be trying to look in "lib" not sure why

With your Maven snippet you're telling Maven to get the jar from this path: {project folder}/lib/jmathplot.jar
You can solve the issue creating a lib folder in the Eclipse project and then copy there the jmathplot jar.
You can download the jar from here: http://jmathplot.googlecode.com/svn/trunk/jmathplot/dist/jmathplot.jar

Related

Maven exported jar doesnt find maven dependency although I can run the main class with no problems

So I added these maven dependencies in my project which will allow me to encode my logs in JSON. After doing this I reloaded maven on IntelliJ and I was able to run the Main class and use these dependencies:
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>7.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
<version>2.6.1</version>
</dependency>
When I do mvn clean install -DskipTests and run the exported jar then I get this error:
2023-01-11 13:07:54 13:07:54,863 |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not create component [encoder] of type [net.logstash.logback.encoder.LogstashEncoder] java.lang.ClassNotFoundException: net.logstash.logback.encoder.LogstashEncoder
Would someone know why the exported jar complains about not finding this dependency although when running the main class the dependency seems to be in use? Thanks in advance for the help

why one of my dependency's maven coordinates in pom file changed follow the new project's maven coordinates

I have created a maven archetype from a project, in this project's pom file, there's an dependency demo-admin
<dependency>
<groupId>com.demo</groupId>
<artifactId>demo-admin</artifactId>
<version>${demo-admin.version}</version>
</dependency>
this dependency is installed in my local repository.
But when I checked the generated archetype files, the pom.xml file in the archetype-resources folder, the dependency looks as below
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-admin</artifactId>
<version>${version}</version>
</dependency>
so every times I create a new project from the archetype, the maven coordinates of this denpendency will change.
Anybody has the same issue?
EDIT:
This issue could be reproduced as below steps:
create a project which GAV as below
<groupId>com.demo</groupId>
<artifactId>abc-admin</artifactId>
<version>1.0.0</version>
create a project which GAV as below
<groupId>com.demo</groupId>
<artifactId>abc</artifactId>
<version>1.0.0</version>
the second project contains a dependency
<dependency>
<groupId>com.demo</groupId>
<artifactId>demo-admin</artifactId>
<version>1.0.0</version>
</dependency>
create an archetype from the second project using the command below
a. cd abc
b. mvn clean
c. mvn archetype:create-from-project
go the "abc/target/generated-sources/archetype/src/main/resources/archetype-resources" folder, you can see a pom file, in the pom file, the dependency looks as below
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-admin</artifactId>
<version>${version}</version>
</dependency>
so, if I create a new project based on the abc archetype, when I input different GAV, the dependency will also changed based on the input values
I guess this is the automatic replacement of your of the groupId and artifactId of your demo project by placeholders.
Either give you demo project some name that never appears anywhere else or edit the resulting archetype by replacing the placeholders with the correct values.

Adding Twitter Jar File as a Maven dependency in eclipse

How can I add the Twitter4j core jar file as a Maven dependency in my project please? I am using eclipse Java.
Add the following dependency in the pom.xml file.
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>4.0.7</version>
</dependency>

Can't Find JBoss-as-client-5.1.0.GA.jar to download

I am looking for JBoss-as-client-5.1.0.GA.jar to download it and I can not seem to find it on the Maven Repository (this is what I find: jboss-as-client) When what I need is the files attribute in the description (one similar to Files )
your version of dependencies is so old and you should update the version with below dependencies and update project, then file those jar into .m2 folder.
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>6.0.0.20100721-M4</version>
</dependency>
and
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>5.1.0.GA</version>
</dependency>
Is this you want ?
Update : Hi , you can go to this page and see what all jar will be required as this jar have dependencies on other jar too .
https://mvnrepository.com/artifact/org.jboss.jbossas/jboss-as-client/5.1.0.GA
Once downlaoded check your .m2 folder
Repo in case Central Repo not work
https://repository.jboss.org/nexus/content/groups/public/org/jboss/jbossas/jboss-as-client/
Else you can try
direct download tool
https://jar-download.com/online-maven-download-tool.php

Manually installed maven dependencies not visible in Eclipse import

I have installed maven dependency using the command below
mvn install:install-file -Dfile=d2_lib.war -DgroupId=com.emc.d2fs -DartifactId=d2_lib -Dversion=1.0 -Dpackaging=war -DlocalRepositoryPath="C:\Users\kumarr23\.m2\repository"
I have added this dependency in my root pom.xml as below
<dependency>
<groupId>com.emc.d2fs</groupId>
<artifactId>d2_lib</artifactId>
<version>1.0</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
I can see when I do maven install the jars inside my final war,
when i try importing these classes from eclipse these classes are not included, Is there some thing I am missing?
I am new to maven and i am stuck here !
please advise
Please check if you have d2_lib.war file at the location from where you are running command or else mention the full path of d2_lib.war in command and try again , i believe with the command you specify it is not copying the war file since war file path is not defined properly , you can confirm this by checking if war file is copied to your local maven repository
mvn install:install-file -Dfile=d2_lib.war -DgroupId=com.emc.d2fs -DartifactId=d2_lib -Dversion=1.0 -Dpackaging=war -DlocalRepositoryPath="C:\Users\kumarr23.m2\repository"
There is a convention in maven that java code lives in a .jar file and web classes live in a .war file. When you include a dependency with the war type in your web project, maven will treat the included file as an overlay. This basically means that maven will package the contents of the dependency into your war file, however it will not include the libraries in that war as java code the way you are looking for.
When a war file is created, if the creator also wants people to get at the java code and transitive dependencies the code is based off of, they can use the maven-war-plugin to set a configuration tag of <attachClasses>true</attachClasses>. This will generate an additional artifact in the form of artifactId-version-classes.jar, along with the normal artifactId-version.war file.
When you include both the war as an overlay and the classes jar as a normal dependency, you will be able to see in your dependency tree that maven is only pulling in transitive dependencies from the jar file dependency, not the war.
In your case, you need to find the classes jar file and install it along with the war file in your local maven repository. Then you can add the classes jar to your pom.xml like so:
old pom.xml
<dependency>
<groupId>com.emc.d2fs</groupId>
<artifactId>d2_lib</artifactId>
<version>1.0</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
new pom.xml
<dependency>
<groupId>com.emc.d2fs</groupId>
<artifactId>d2_lib</artifactId>
<version>1.0</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.emc.d2fs</groupId>
<artifactId>d2_lib</artifactId>
<version>1.0</version>
<classifier>classes</classifier>
</dependency>

Categories