0

This may seem like a simple question to many but I could not find anything similar here so posting the same. Really sorry if found a duplicate.

I am using the Moxy library in my application and I found a bug in it. I tried to change the code directly but I get the error class file is read only so I wanted to fix that bug on the source code and use the JAR created from this fixed code to be used as a dependency in my Maven project. But I am running into various issues.

At first, I got the code for it from GitHub, created a new branch, and made only one line of small change to it as mentioned in the ticket. Apart from this one line of code nothing has been changed for the library code.

org.eclipse.persistence.internal.oxm.record.UnmarshalRecordImpl 
public XPathNode getNonAttributeXPathNode(String namespaceURI, String localName, String qName, Attributes attributes) {
...
Line 1376
       if(null == resultNode && null == nonPredicateNode) {
          // ANY MAPPING
          //resultNode = xPathNode.getAnyNode();
          resultNode = null;
       }

After this, I am trying to create a JAR file of it by following the steps mentioned in the following answer. I am running into various issues such as:

1. java: package jakarta.jms is not visible (package jakarta.jms is declared in the unnamed module, but module org.eclipse.persistence.core does not read it)

When I fix this using the IDE suggestion and build again then I get the next error:

2. java: package javax.rmi.CORBA is not visible
  (package javax.rmi.CORBA is declared in the unnamed module, but module org.eclipse.persistence.core does not read it)

This build and fix thing continued for some time and I fixed everything then I finally run into following error:

java: the unnamed module reads package commonj.sdo from both org.eclipse.persistence.sdo and commonj.sdo

So basically for some reason, I am unable to create a JAR and use it in my project as a dependency.

I have few things which I want to get clarification on:

  1. I wanted to know am I following the right method?
  2. If I am not making any changes to the other file why am I running into so many issues when I did not make any changes to other things?
  3. The source code has many submodules I wanted to know how can I locate the Main.class file or any file which is the first point of entry to the code.
  4. Is there something I am missing or is there any better workaround than the mentioned steps or flow here?

Looking for some suggestions or help. Thanks in advance.

  • I would recommend you to check this project's [build process](https://wiki.eclipse.org/EclipseLink/Building). See in particular [**building with Ant**](https://wiki.eclipse.org/EclipseLink/Building#Building_with_Ant) section about how to produce the project's artifacts. – Andrey Jun 07 '21 at 12:26

0 Answers0