1

I'm getting an error message on a "mvn clean install" command, as follows:

    Failed to execute goal on project image-server-core: 
    Could not resolve dependencies for project com.xxxx:image-server-core:jar:2.0.7: 
Failure to find javax.transaction:jta:jar:1.0.1B in
    http://repo1.maven.org/maven2 was cached in the local repository, resolution
    will not be reattempted until the update interval of repo1.maven.org has elapsed or updates are forced -> 

I did some googling and tried adding the following dependency

<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>

But it just said something about access being forbidden. While this seems to be a fairly common error, my understanding of the maven is very limited - for example, how to I trace what's linking to the dependency on javax.transaction:jta:jar:1.0.1B? More importantly, how do I remedy it?

Here's the pom.xml:

<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>

    <parent>
        <groupId>com.xxxx</groupId>
        <artifactId>image-server</artifactId>
        <version>2.0.7</version>
    </parent>

    <artifactId>image-server-core</artifactId>
    <version>2.0.7</version>
    <packaging>jar</packaging>
    <name>xxxx-${project.artifactId}</name>

    <build>
        <finalName>${project.name}</finalName>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings 
                    only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-jar-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.6,)
                                        </versionRange>
                                        <goals>
                                            <goal>test-jar</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.xxx</groupId>
            <artifactId>image-server-utils</artifactId>
            <version>1.0.7</version>
        </dependency>
        <dependency>
            <groupId>com.xxxx.otblib</groupId>
            <artifactId>otblib</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.xxxx.model</groupId>
            <artifactId>VisionServerModels</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.xxxx.image-server</groupId>
            <artifactId>image-server-rest</artifactId>
            <version>1.0.7</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.ftpserver</groupId>
            <artifactId>ftpserver-core</artifactId>
            <version>1.0.6.1C</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.mina</groupId>
                    <artifactId>mina-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.ftpserver</groupId>
            <artifactId>ftplet-api</artifactId>
            <version>1.0.6.1C</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
            <version>3.5.7.Final</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-bundle</artifactId>
            <version>1.19.1</version>
        </dependency>
        <dependency>
            <groupId>org.modelmapper</groupId>
            <artifactId>modelmapper</artifactId>
            <scope>provided</scope>
        </dependency>


        <!-- Test Jars -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
Jack BeNimble
  • 35,733
  • 41
  • 130
  • 213

3 Answers3

0

According to your pom.xml, i find the hibernate maven dependency, but what's your hibernate version? if you update the hibernate like below:

<dependency>
 <groupId>org.hibernate</groupId>
 <artifactId>hibernate</artifactId>
 <version>3.3.2.ga</version>
</dependency>

it has a recommended dependency for jta. so update your hibernate version. more detail: maven missing dependency jta-1.0.1b

What's more, your pom.xml both have log4j and logback maven dependency. pls look at the difference between log4j and logback:log4j vs logback, if you want to use logback instead of log4j, you would remove the log4j maven dependency, and also add slf4j maven dependency:

 <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.25</version>
    </dependency>
Python Basketball
  • 2,320
  • 3
  • 24
  • 47
  • Thanks for your comment. In fact, when I comment out one of the other dependencies, the "VisionServerModel", the error disappears. So, I don't think it's Hibernate in this case. My next step is to figure out where that module comes from. I wish I knew more about Maven. – Jack BeNimble Jan 25 '18 at 03:00
0

Since this dependency does not exist on maven repository, you can add it directly to your local repository. First download the jar from oracle site : https://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-database-419422.html

The file name would be jdbc2_stdext.jar or something similar.

Now you can install it in local maven with following command :

mvn install:install-file -DgroupId=javax.sql -DartifactId=jdbc-stdext -Dversion=2.0 -Dpackaging=jar -Dfile=jdbc-stdext.jar

0

Download jta-1.0.1B jar and paste into Users(yourUser).m2\repository\javax\transaction\jta\1.0.1B