Maven模块的干净包装问题

时间:2018-08-23 13:19:17

标签: java maven

我有一个带有4个模块的Maven项目。主要是GestionCertificados。它取决于sgclib。当我使用maven命令clean package进行编译时,编译器向我抛出未找到该软件包的错误(但它从maven Central找到了其他软件包)。

该怎么办才能解决?是删除clean package命令的唯一解决方案(当我删除它时,它会起作用)。

Image

确切的错误是:

[WARNING] The POM for aa.bb.cc:sgclib:jar:1.0-SNAPSHOT is missing, no dependency information available

Failed to execute goal on project gestioncertificados: Could not resolve dependencies for project aa.bb.cc:gestioncertificados:war:1.0.0: The following artifacts could not be resolved: aa.bb.cc:sgclib:jar:1.0-SNAPSHOT,  Could not find artifact aa.bb.cc:sgclib:jar:1.0-SNAPSHOT in company 

http://nexus.company.cl/content/groups/public/)-> [帮助1]

错误就像是在我的公司存储库中搜索一样,但我不需要。该模块是本地的

Pom文件:

<?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>aa.bb.cc</groupId>
<artifactId>gestioncertificados</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>

<name>Gestion Certificados</name>

<properties>
    <mainClass>aa.bb.cc.gestioncertificados.tomcat.Server</mainClass>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <jsf-api.version>2.2</jsf-api.version>
    <jsf-mojarra.version>2.2.14</jsf-mojarra.version>
    <primefaces.version>6.1</primefaces.version>
    <primefaces-ext.version>6.0.0</primefaces-ext.version>
    <primefaces-themes.version>1.0.10</primefaces-themes.version>
    <omnifaces.version>2.6.1</omnifaces.version>
    <cdi.version>2.4.2.Final</cdi.version>
    <spring.version>4.3.4.RELEASE</spring.version>
    <springsecurity.version>3.2.9.RELEASE</springsecurity.version>
    <springwebflow.version>2.4.4.RELEASE</springwebflow.version>
    <apache-cxf.version>3.1.5</apache-cxf.version>
    <tomcat.version>8.5.11</tomcat.version>
    <hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
    <hikaricp.version>2.5.1</hikaricp.version>
    <sqlserver.version>6.1.0.jre8</sqlserver.version>
    <jackson.version>2.8.5</jackson.version>
    <javaemailapi.version>1.5.3</javaemailapi.version>
    <poi.version>3.15</poi.version>
    <velocity.version>1.7</velocity.version>
    <velocity-tools.version>2.0</velocity-tools.version>
    <itex.lowagie.version>2.1.7</itex.lowagie.version>
    <flyingsaucer.version>9.1.5</flyingsaucer.version>
    <commons-lang3.version>3.3.2</commons-lang3.version>
    <commons-collections.version>3.2.1</commons-collections.version>
    <commons-lang.version>2.6</commons-lang.version>
    <commons-fileupload.version>1.3.1</commons-fileupload.version>
    <commons-io.version>2.4</commons-io.version>
    <commons-beanutils.version>1.8.0</commons-beanutils.version>
    <commons-codec.version>1.4</commons-codec.version>
    <slf4j.version>1.7.5</slf4j.version>
    <junit.version>4.12</junit.version>
    <assertj.version>3.2.0</assertj.version>
    <mockito.version>1.10.19</mockito.version>
    <pdfbox.version>2.0.9</pdfbox.version>
    <woodstox.version>5.1.0</woodstox.version>
</properties>

<dependencies>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2.11</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-core</artifactId>
        <version>2.2.11</version>
    </dependency>

    <!-- embed tomcat-->
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-core</artifactId>
        <version>${tomcat.version}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
        <version>${tomcat.version}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-logging-log4j</artifactId>
        <version>8.5.2</version>
        <scope>compile</scope>
    </dependency>

    <!-- JSF -->
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>javax.faces-api</artifactId>
        <version>${jsf-api.version}</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>${jsf-mojarra.version}</version>
    </dependency>

    <!-- JSF PRIMEFACES -->
    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>${primefaces.version}</version>
    </dependency>
    <dependency>
        <groupId>org.primefaces.extensions</groupId>
        <artifactId>primefaces-extensions</artifactId>
        <version>${primefaces-ext.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.primefaces</groupId>
                <artifactId>org.primefaces</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.primefaces.themes</groupId>
        <artifactId>all-themes</artifactId>
        <version>${primefaces-themes.version}</version>
    </dependency>

    <!-- JSF OMNIFACES -->
    <dependency>
        <groupId>org.omnifaces</groupId>
        <artifactId>omnifaces</artifactId>
        <version>${omnifaces.version}</version>
    </dependency>

    <!-- CDI -->
    <dependency>
        <groupId>org.jboss.weld.servlet</groupId>
        <artifactId>weld-servlet</artifactId>
        <version>${cdi.version}</version>
    </dependency>

    <dependency>
        <groupId>javax.websocket</groupId>
        <artifactId>javax.websocket-api</artifactId>
        <version>1.1</version>
    </dependency>

    <!-- URLREWRITE -->
    <dependency>
        <groupId>org.tuckey</groupId>
        <artifactId>urlrewritefilter</artifactId>
        <version>4.0.3</version>
    </dependency>


    <!-- spring framework -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <!-- spring webflow -->
    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-webflow</artifactId>
        <version>${springwebflow.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-binding</artifactId>
        <version>${springwebflow.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-js</artifactId>
        <version>${springwebflow.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-faces</artifactId>
        <version>${springwebflow.version}</version>
    </dependency>

    <!-- spring security -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>${springsecurity.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>${springsecurity.version}</version>
    </dependency>

    <!-- jackson -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
    </dependency>


    <!-- Apache POI -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>${poi.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>${poi.version}</version>
    </dependency>

    <!-- Apache Commons -->
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>${commons-collections.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>${commons-lang.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>${commons-fileupload.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>${commons-beanutils.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>${commons-codec.version}</version>
    </dependency>

    <!-- velocity -->
    <dependency>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity</artifactId>
        <version>${velocity.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity-tools</artifactId>
        <version>${velocity-tools.version}</version>
    </dependency>

    <!-- flyingsaucer - xhtmlrenderer -->
    <dependency>
        <groupId>org.xhtmlrenderer</groupId>
        <artifactId>flying-saucer-pdf</artifactId>
        <version>${flyingsaucer.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcmail-jdk14</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bctsp-jdk14</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk14</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>aa.bb.cc</groupId>
        <artifactId>sgclib</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>aa.bb.cc</groupId>
        <artifactId>sgclibdocuments</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>
            <configuration>
                <useSystemClassLoader>false</useSystemClassLoader>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.18.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <useSystemClassLoader>false</useSystemClassLoader>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <mainClass>${mainClass}</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>

        <!-- war plugin-->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <warName>${project.artifactId}-${project.version}</warName>
            </configuration>
        </plugin>

    </plugins>
</build>

<repositories>
    <repository>
        <id>company</id>
        <url>http://nexus.company.cl/content/groups/public/</url>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>company</id>
        <url>http://nexus.company.cl/content/groups/public/</url>
    </pluginRepository>
</pluginRepositories>

1 个答案:

答案 0 :(得分:0)

您没有将GestionCertificados所依赖的项目声明为模块,因此必须首先将那些依赖项安装到本地maven存储库,然后才能打包GestionCertificados

在您的sgclibdocumentsfieldprocessor呼叫mvn install中,您的mvn clean package应该可以工作。