当前位置: 首页 > 知识库问答 >
问题:

为什么这只耳朵找不到他的依赖?

卜昂熙
2023-03-14

我刚刚做了一个项目。我以前用过ant,它有以下结构:

MYPROJECT/pom.xml(耳)MYPROJECT-EJBpom.xmlMYPROJECT-WARpom.xml

如果我构建ejb和jar项目,它就会工作。如果我把所有东西都清理干净,从耳朵开始,它就不会。下面是我从jenkins的“maven clean install”中得到的信息:

[警告]be的POM。瓦卢亚。myproject:myproject ejb:jar:1.0-缺少快照,没有可用的依赖关系信息[警告]be的POM。瓦卢亚。myproject:myproject war:war:1.0-缺少快照,没有可用的依赖关系信息[警告]be的POM。瓦卢亚。myproject:myproject ws:war:1.0-缺少快照,没有可用的依赖关系信息

顺便说一句,我不知道应该如何找到这些依赖项,但这正是我想要的。

这是我耳朵的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>be.valuya.myproject</groupId>
    <artifactId>myproject</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>ear</packaging>

    <name>myproject</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <version>6</version>
                    <defaultLibBundleDir>lib</defaultLibBundleDir>
                    <applicationName>myproject</applicationName>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>myproject-ejb</artifactId>
            <version>${project.version}</version>
            <type>ejb</type>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>myproject-war</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>myproject-ws</artifactId>
            <version>${project.version}</version>
            <type>war</type>
        </dependency>
    </dependencies>
</project>

这是我的ejb模块的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>

    <groupId>be.valuya.myproject</groupId>
    <artifactId>myproject-ejb</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>ejb</packaging>

    <name>myproject-ejb</name>

    <repositories>
        <repository>
            <id>EclipseLink Repo</id>
            <!-- note that ampersands in this URL are escaped because this is in an xml file -
                   un-escape them to use in browser 
            -->
            <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
        </repository>         
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>maven-annotation-plugin</id>
            <url>http://maven-annotation-plugin.googlecode.com/svn/trunk/mavenrepo</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <ejbVersion>3.1</ejbVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>6.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>1.3.5</version>
                <executions>
                    <execution>
                        <id>process</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <compilerArguments>-Aeclipselink.persistencexml=src/main/resources/META-INF/persistence.xml</compilerArguments>
                            <processors >
                                <processor>org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor</processor>
                            </processors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>-->
        </plugins>
    </build>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.jpa</artifactId>
            <version>2.3.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
            <version>2.3.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.jpa.modelgen</artifactId>
            <version>2.3.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>4.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.5-FINAL</version>
        </dependency>
        <dependency>
            <groupId>jfree</groupId>
            <artifactId>jfreechart</artifactId>
            <version>1.0.13</version>
        </dependency>
        <dependency>
            <groupId>jfree</groupId>
            <artifactId>jcommon</artifactId>
            <version>1.0.16</version>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>

共有1个答案

梁丘俊材
2023-03-14

制作了一个超级动画。好多了,虽然还不够完美(但我会问另一个问题)。

 类似资料:
  • 我有一个Java web应用程序myproject。war部署到JBoss。应用程序的一部分使用JNI连接到C DLL,后者从一组第三方库调用函数。我们正在将此应用程序从x32服务器迁移到x64服务器。 先前环境构建 32位Windows Server 2003 JBoss 6. X Java1.6. X 新环境构建 64位Windows Server 2008 R2,SP1(6.1.7601)

  • 我正在使用Eclipse和Gradle。Twilio被列为依赖项。所有版本都是最新的。引用Gradle的代码将无法编译,并返回Twilio类不存在的错误消息。在线代码令人沮丧地过时了。我希望这里有人能帮忙。 我正在运行的代码非常基本:

  • 我看到一个错误消息(uncattle typeerror:Cannot read property'add eventlistener'为null)我想问题是(getElementsByTagName)但无论如何它无法到达元素我想要的问题是什么

  • 问题内容: 我正在尝试打开一个保存在源文件夹本身中的CSV文件名“ logger.csv”。 但是,这一直在给我一个“找不到文件”错误。 问题答案: 如果您现在就使用相对路径,则该文件需要存在于项目根目录中, 而不是 存在于java文件的目录中。 考虑以下层次结构: 不管用。 将 现在 的工作。(注意,该文件与src目录相邻。)

  • 问题内容: 我创建了一个整数列表,并试图返回特定值的索引。该数组是3,8,2,5,1,4,7,6并且我想返回indexOf(3),应该为0。 导入java.util。*后,我在Eclipse Java Scrapbook中尝试了以下操作: 我也尝试过: 两者都返回-1。为什么?如何使它按预期工作? 问题答案: 它不是为了使它起作用。

  • 问题内容: 为什么在使用sudo时找不到命令“ bundle”: 但是在不使用sudo时确实存在: 我问的原因是我正在关注https://github.com/gitlabhq/gitlab- recipes/tree/master/install/centos ,它指出要使用sudo。 所述添加标志…引发’bundle:命令未找到’错误,但显示“此帐户当前不可用”。 问题答案: 使用和不检查的值