如何修复丢失神器的POM?

时间:2015-07-02 09:27:34

标签: java maven

我的POM问题不是我的。就是这样。

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

这是错误:缺少工件javax.transaction:jta:jar:1.0.1B

无法从https://maven-repository.dev.java.net/nonav/repository传输javax.jms:jms:jar:1.1缓存在本地存储库中,在java.net的更新间隔过去或强制更新之前,不会重新尝试解析。原始错误:无法传输工件javax.jms:jms:jar:1.1 from / to java.net(https://maven-repository.dev.java.net/nonav/repository):无法使用可用的连接器工厂访问类型为legacy的https://maven-repository.dev.java.net/nonav/repository:AetherRepositoryConnectorFactory,BasicRepositoryConnectorFactory < / p>

请帮忙

3 个答案:

答案 0 :(得分:1)

尝试将此依赖项添加到POM:

<dependency>
    <groupId>javax.transaction</groupId>
    <artifactId>jta</artifactId>
    <version>1.0.1B</version>
</dependency>

答案 1 :(得分:1)

如果你真的想要javax.transaction:jta:jar:1.0.1B工件,它可用here,所以你可以添加http://mirrors.ibiblio.org/maven/mule/dependencies/maven2/作为repository in your pom来拥有maven下载它,或手动下载install it yourself

但你应该做的是将log4j版本升级到1.2.17,因为1.2.15 has bad metadata。你也可能想要依赖org.apache.wicket:wicket-core而不是org.apache.wicket:wicket因为org.apache.wicket:wicket是aggregator project,而不是jar。

答案 2 :(得分:1)

只需简单地从有问题的依赖项中剔除jta工件。 例如:

        <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>
相关问题