Maven dependency for pd4ml - java

HI I searched on google and did not find the dependency for PD4ML.I have added the jar manually but everytime i do mvn clean install it is giving me compile time error
error: package org.zefer.pd4ml does not exist
org.zefer.pd4ml does not exist

I got the answer after hours spending on it
step one :download the pd4ml.jar
step two :Run the below command on command prompt
mvn install:install-file -Dfile=D:\<path to your downloaded jar>\pd4ml.jar -DgroupId=com.pd4ml.utilities -DartifactId=pd4ml -Dversion=1.0 -Dpackaging=jar
step 3 : add the dependency on pom.xml based on the groupId and artifactsId you have provided
<dependency>
<groupId>com.pd4ml.utilities</groupId>
<artifactId>pd4ml</artifactId>
<version>1.0</version>
</dependency>
Remember ss_css2 jar is also require to run the pd4ml follow the above steps to create a mvn depedency for this jar

Did you add a dependency to the pom.xml file?
Something like:
<dependency>
<groupId>org.zefer.pd4ml</groupId>
<artifactId>pd4ml</artifactId>
<version>3.2.3fx5</version>
</dependency>

In your pom.xml add the repository first to resolve the pd4ml as below:
<repositories>
<repository>
<id>my-repo2</id>
<name>your custom repo</name>
<url>http://maven.scandilabs.com/repository</url>
</repository>
</repositories>
and then in the dependencies add dependency as below:
<dependency>
groupId>org.zefer.pd4ml</groupId>
<artifactId>pd4ml</artifactId>
<version>370fx2</version>
</dependency>

Add the repository https://pd4ml.tech/maven2/ and the dependency com.pd4ml to your pom.xml:
<project ...>
<groupId>de.luckydonald.stackoverflow</groupId>
<artifactId>42805145</artifactId>
<version>1.0-SNAPSHOT</version>
<repositories>
<repository>
<id>pd4ml</id>
<url>https://pd4ml.tech/maven2/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<!-- html to rtf -->
<dependency>
<groupId>com.pd4ml</groupId>
<artifactId>pd4ml</artifactId>
<version>4.0.2</version>
</dependency>
</dependencies>
</project>

Related

How to resolve a Maven dependency of type pom?

I am trying to import a library in Maven which is Kotlin Multiplatform.
This is it's Github repo (does not actually matter much of course)
Point is, it says it can be imported in with this dependency for Gradle:
dependencies {
implementation("com.github.ajalt.colormath:colormath:2.0.0")
}
Obviously, just converting it to Maven does not work:
<dependencies>
...
<dependency>
<groupId>com.github.ajalt.colormath</groupId>
<artifactId>colormath</artifactId>
<version>2.0.0</version>
<type>jar</type>
</dependency>
</dependencies>
So I added it's pom to the project as this answer explains it:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.github.ajalt.colormath</groupId>
<artifactId>colormath</artifactId>
<version>2.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
This dependency is resolved (it can be only resolved as pom type. Then I add it as dependency:
<dependencies>
...
<dependency>
<groupId>com.github.ajalt.colormath</groupId>
<artifactId>colormath</artifactId>
<version>2.0.0</version>
<type>jar</type>
</dependency>
</dependencies>
It still cannot find it.
I also added the repo1, because I did not see where Maven was looking for this artifact:
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo1.maven.org/maven2</url>
</repository>
</repositories>
But still no success. I don't understand why it's not working.
The code can be found in the repo1, but Maven does not resolve it.
This must be a very simple thing I am not understanding here, please help.
The link to the Maven Central from GitHub points to a bare POM artifact, without any dependencies and/or attached JARs.
It looks like Kotlin MP uploads JVM-specific artifacts with a different artifactId - colormath-jvm in this case. Please check corresponding directory in the Maven Central.
I suggest using following dependency declaration in the POM:
<groupId>com.github.ajalt.colormath</groupId>
<artifactId>colormath-jvm</artifactId>
<version>2.0.0</version>

Maven plugin for running JWebAssembly

I can see that JWebAssembly can be built with gradle
https://github.com/i-net-software/JWebAssembly/wiki/Build-with-Gradle
but they also provide examples for adding maven dependencies, so I would expect that there is a maven plugin as well. I can't find it anywhere. How to run JWebAssembly with maven?
This is from the same github wiki(https://github.com/i-net-software/JWebAssembly/wiki/Getting-Started#add-dependency-to-api):
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.i-net-software</groupId>
<artifactId>jwebassembly-api</artifactId>
<version>master-SNAPSHOT</version>
</dependency>

Unable to add IBM db2jcc4 jar file through Maven

I am trying to access DB2 tables in a java project. I am able to access the tables when I manually added the jar files - db2jcc4.jar and db2jcc_license_cisuz.jar. No issues in accessing the tables.
But when I try to add these jar files through Maven, they won't add to the project.
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>db2jcc4</artifactId>
<version>9.7.0.4</version>
</dependency>
Error Message - Missing artifact id.
Also, the latest db2jcc4.jar files (Version 11.1) are not present in Maven repository. Is there any other place I can access it from?
You have to download the right driver from IBM.
http://www-01.ibm.com/support/docview.wss?uid=swg21363866
Then install it to your local maven repository
http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html
As written in maven central repository the artifact is in another repo.
Add it to your pom and it will work.
<repositories>
<repository>
<id>Alfresco</id>
<name>Alfresco</name>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
</repositories>
Assuming that , using share drive is the option to go.
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>licences</artifactId>
<version>0.7</version> <!-- Adjust this properly -->
<scope>system</scope>
<systemPath>R:\JDBC drivers\IBM DB2_db2_2.2.0.v20130525_0720\db2jcc_license_cisuz.jar</systemPath>
</dependency>
According to maven central repository the artifact is in another repository. Include these two in your pom.xml and it should work:
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc4</artifactId>
<version>10.1</version>
</dependency>
<repositories>
<repository>
<id>com.ibm.db2.jcc</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
</repositories>

Why is Maven not finding this jar

I have the following JAR that my project needs so I added it to my pom.xml...
<dependency>
<groupId>org.reficio</groupId>
<artifactId>soap-builder</artifactId>
<version>1.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.apache.ws.commons.schema</groupId>
<artifactId>XmlSchema</artifactId>
</exclusion>
</exclusions>
</dependency>
But when I run Maven it tries to download from various repos and finally fails. It only creates a "lastUpdated" file whose contents are below..
http\://repository.jboss.org/nexus/content/groups/public-jboss/.lastUpdated=1392941827625
http\://www.terracotta.org/download/reflector/releases/.lastUpdated=1392941828195
Does anyone have any suggestions? Is this JAR simply not there anymore?
Thanks.
That artefact isn't in Maven Central (or other default repo) and so Maven won't find it automatically. The reficio/soap-ws page on Github explains:
soap-ws is not yet located in the central maven repo, thus you also have to add an additional repository to your config.
<repositories>
<repository>
<id>reficio</id>
<url>http://repo.reficio.org/maven/</url>
</repository>
</repositories>

Maven project with PI4J library - error in opening zip file

I've got quite strange problem with pi4j library to Raspberry Pi. I have Maven project in Eclipse and just added repository and dependency for pi4j like this:
<repository>
<id>oss-snapshots-repo</id>
<name>Sonatype OSS Maven Repository</name>
<url>https://oss.sonatype.org/content/groups/public</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
I don't have any pi4j code in my project and I get this error while doing mvn install:
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on
project kosciol-main: Error creating shaded jar: error in opening zip
file
d:\Programy\apache-maven-3.1.1\m2\repositories\com\pi4j\pi4j-native\1.0-SNAPSHOT\pi4j-native-1.0-SNAPSHOT-hard-float.so
-> [Help 1]
If I delete dependency, project compiles without errors...
I tried to delete this pi4j repository from m2 folder but this didn't help.
How can I solve it?
Try to specify the scope of the dependency as "provided", like this:
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-core</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

Categories