Login  Register

Re: Java3d on the Maven Central Repository

Posted by riccaricca68 on May 14, 2023; 6:37pm
URL: https://forum.jogamp.org/Java3d-on-the-Maven-Central-Repository-tp4042372p4042602.html

Hi Sven,

thank you for your reply. What I'm asking is very simple: just put the maven artifacts of j3dcore.jar, vecmath.jar and j3dutils.jar version 1.7.1-build-20200222 on your destination https://www.jogamp.org/deployment/maven-java3d/, which is now present and accessible (albeit empty). The artifacts I'm interested in are the ones at https://jogamp.org/deployment/java3d/1.7.1-build-20200222/. To do a good job, it is important to produce the pom.xml files for these artifact. A rather simple way to do it, if you have SSH access to the target file system, is to use maven itself, by running the commands:

mvn deploy:deploy-file -Durl=scp://<host:port>/<path-to-java3d-repo>/ -Dfile=./j3dcore.jar -DgroupId=org.jogamp.java3d -DartifactId=j3dcore -Dversion=1.7.1-build-20200222 -DrepositoryId=maven-java3d

mvn deploy:deploy-file -Durl=scp://<host:port>/<path-to-java3d-repo>/ -Dfile=./j3dutils.jar -DgroupId=org.jogamp.java3d -DartifactId=j3dutils -Dversion=1.7.1-build-20200222 -DrepositoryId=maven-java3d

mvn deploy:deploy-file -Durl=cp://<host:port>/<path-to-java3d-repo>/ -Dfile=./vecmath.jar -DgroupId=org.jogamp.java3d -DartifactId=vecmath -Dversion=1.7.1-build-20200222 -DrepositoryId=maven-java3d

For these commands to work, you need two things:

1) Enter your SSH credentials in the maven settings.xml descriptor (which you can find or create in /<your user home>/.m2), like this:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
   ...
   <servers>
    ...
      <server>
            <id>maven-java3d</id>
            <username>user</username>
            <password>pass</password>
        </server>
  </servers>
</settings>

2) To make maven use the SCP protocol, create a fake pom.xml file in the same folder you want to run the above commands from, like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>fake</groupId>
  <artifactId>fake</artifactId>
  <version>0.0.0</version>
 
  <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>3.5.3</version>
            </extension>
        </extensions>       
        </build>
</project>

If you HTTP server allows POST and PUT methods, instead of using SCP you can upload the artifacts using http / https protocols, which are natively supported by maven. In that case you don't need the fake pom.xml file.

Hope these hints will help you. Best regards,
Riccardo.