What are the dependencies I need in Gradle? [closed]

1

What are the dependencies required for the following libraries?

import java.io.StringReader;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.util.ArrayList;
import java.util.List;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
    
asked by anonymous 31.01.2018 / 22:23

1 answer

2

javax.xml.parsers

The javax.xml.parsers package corresponds to JAXP and can be found in jaxp-api-1.4.5.jar . For Gradle, you would use this:

compile group: 'javax.xml.parsers', name: 'jaxp-api', version: '1.4.5'

It is also distributed in the default library. In Java 9 it is in module java.xml .

javax.xml.soap

The javax.xml.soap package corresponds to the SAAJ and can be found in saaj-api-1.3.5.jar . For Gradle, you would use this:

compile group: 'javax.xml.soap', name: 'saaj-api', version: '1.3.5'

It is also distributed in the default library. In Java 9 it is in the module java.xml.ws , but since this module is marked with @Deprecated(since="9", forRemoval=true) , then it is better to import it as a library in Gradle than to use the default Java 9 module. This does not mean that the SAAJ has been discontinued or abandoned, it just means that it will no longer be distributed as part of JDK after Java 9, and should then be added as an external dependency (just what Gradle does).

java.net , java.io and java.util

The java.net , java.io , and java.util packages are in the default library. In Java 9, they are all in the java.base module . That way, you do not have to do anything special in Gradle to use them.

org.w3c.dom and org.xml.sax

The org.w3c.dom and org.xml.sax packages are also in the default library. In Java 9, they are in module java.xml . p>     

31.01.2018 / 22:45