Exchange class file in maven dependeny with fixed java in Eclipse

I want to exchange one file depending on maven (docx4j) using Eclipse. Thus, no command-line tools for maven are installed right now. I have two files .javathat I downloaded manually from github that should overwrite two files .class. And I would like to achieve this without creating the whole project.

Another perspective: There are source code changes for the library in the github repository that are not published in the released version on the maven central server. And there is no jar file. But I want to use these changes in my project, which gets its dependencies, although maven. And I would like to avoid going into the deployment process of the structure itself.

I read in how to edit the .class file depending on Maven in Eclipse that this is not possible without restoring the project. But I got a hint in How to accept track changes / changes (ins / del) in docx? that can be used mvn install:install-file. But the Maven manual also just talks about a JAR for exchange, not a single .java file, which should replace the .class file.

my pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>myGroup</groupId>
    <artifactId>myArtefact</artifactId>
    <version>0.1</version>
    <name>myName</name>
    <description>myDescription</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.docx4j</groupId>
            <artifactId>docx4j</artifactId>
            <version>3.3.5</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.0</version>
        </dependency>
    </dependencies>
    <build>
        [...]
    </build>
</project>
+4
source share
1 answer

, " ". pom.xml, , docx4j-master.zip, mvn install. docx4j , pom.xml . , , . , , .

+1

Source: https://habr.com/ru/post/1683950/


All Articles