4

I have a problem with a POM which is not mine. Here is it.

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.sms.smsoffice</groupId>
        <artifactId>sms-office</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>sms-office-ui</artifactId>
    <packaging>jar</packaging>
    <name>sms office ui</name>
    <description>sms office ui</description>

    <build>
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/java</directory>
                <targetPath>${project.build.outputDirectory}</targetPath>
                <includes>
                    <include>**</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
                <targetPath>${project.build.outputDirectory}/resources</targetPath>
                <includes>
                    <include>**</include>
                </includes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make shared resources</id>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/resources.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Project Internal Dependencies -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>sms-office-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- External dependencies -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket</artifactId>
            <version>${wicket.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-extensions</artifactId>
            <version>${wicket.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-datetime</artifactId>
            <version>1.4.3</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-auth-roles</artifactId>
            <version>${wicket.auth-roles.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-spring</artifactId>
            <version>1.4.7</version>
        </dependency>
    </dependencies>
</project>

This is the error: Missing artifact javax.transaction:jta:jar:1.0.1B

Failure to transfer javax.jms:jms:jar:1.1 from https://maven-repository.dev.java.net/nonav/repository was cached in the local repository, resolution will not be reattempted until the update interval of java.net has elapsed or updates are forced. Original error: Could not transfer artifact javax.jms:jms:jar:1.1 from/to java.net (https://maven-repository.dev.java.net/nonav/repository): Cannot access https://maven-repository.dev.java.net/nonav/repository with type legacy using the available connector factories: AetherRepositoryConnectorFactory, BasicRepositoryConnectorFactory

Please help

johnpolqkov
  • 93
  • 2
  • 13
  • Might want to try this answer on [maven-failing-to-resolve-recursive-dependencies-with-multiple-repositories](http://stackoverflow.com/questions/7894794/maven-failing-to-resolve-recursive-dependencies-with-multiple-repositories#answer-25075085). Looks like excluding a few dependencies from log4j does the trick. – asgs Jul 02 '15 at 09:41
  • its not log4j I tried... – johnpolqkov Jul 02 '15 at 11:54
  • look at this answer http://stackoverflow.com/a/19086931/4311135 – Yuri G. Jul 02 '15 at 15:36

3 Answers3

2

If you want really want that javax.transaction:jta:jar:1.0.1B artifact, it's available here, so you can either add http://mirrors.ibiblio.org/maven/mule/dependencies/maven2/ as a repository in your pom to have maven download it, or download it manually and install it yourself.

But what you should probably do instead is upgrade your log4j version to be 1.2.17 because 1.2.15 has bad metadata. You'll also likely want to depend on org.apache.wicket:wicket-core instead of org.apache.wicket:wicket because org.apache.wicket:wicket is an aggregator project, not a jar.

Community
  • 1
  • 1
heenenee
  • 19,914
  • 1
  • 60
  • 86
1

Try adding this dependency to the POM:

<dependency>
    <groupId>javax.transaction</groupId>
    <artifactId>jta</artifactId>
    <version>1.0.1B</version>
</dependency>
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
  • when I add this, on the dependency shows this error: Missing artifact javax.transaction:jta:jar:1.0.1B – johnpolqkov Jul 02 '15 at 09:42
  • What does `on the dependency shows this error` mean? Did you do a `mvn clean install` ? – Tim Biegeleisen Jul 02 '15 at 09:44
  • yes I did clean install and next to the your new dependency I pasted there it shows this error: Missing artifact javax.transaction:jta:jar:1.0.1B. And also its underline with red. In fact this could not be found – johnpolqkov Jul 02 '15 at 09:53
  • OK it's time to get heavy-handed here. Can you delete the _entire_ `javax` directory from your `.m2` folder? Then do a `mvn clean install` and let me know what happens. – Tim Biegeleisen Jul 02 '15 at 10:09
1

Just simple exculde the jta artifact from the problematic dependency. For example:

        <dependency>
            <groupId>org.codehaus.castor</groupId>
            <artifactId>castor</artifactId>
            <version>1.1</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.transaction</groupId>
                    <artifactId>jta</artifactId>
                </exclusion>
            </exclusions>
        </dependency>