在maven构建包时出错。

时间:2022-09-06 21:12:00

I am trying to build a bundle from existing maven project which is in eclipse. I have most of the repository dependencies, still though it tries to download a few dependencies. after that it give list of errors which is below.Can anybody tell how to remove existing errors and build a bundle successfully. I am building the bundle for Adobe Aem aq5 tool where it accepts jar files as bundles to be installed.

我正在尝试从eclipse中现有的maven项目中构建一个包。我拥有大多数存储库依赖项,尽管它尝试下载一些依赖项。然后给出下面的错误列表。谁能告诉我们如何清除现有的错误并成功地构建一个包。我正在为adobeaem aq5工具构建包,在那里它接受jar文件作为包的安装。

    [ERROR] Unresolveable build extension: Plugin org.apache.felix:maven-bundle-plug
in:2.3.7 or one of its dependencies could not be resolved: The following artifac
ts could not be resolved: org.apache.maven:maven-core:jar:2.0.7, org.apache.mave
n:maven-settings:jar:2.0.7, org.apache.maven:maven-plugin-parameter-documenter:j
ar:2.0.7, org.apache.maven:maven-profile:jar:2.0.7, org.apache.maven:maven-model
:jar:2.0.7, org.apache.maven:maven-artifact:jar:2.0.7, org.codehaus.plexus:plexu
s-container-default:jar:1.0-alpha-9-stable-1, org.apache.maven:maven-repository-
metadata:jar:2.0.7, org.apache.maven:maven-error-diagnostics:jar:2.0.7, org.apac
he.maven:maven-project:jar:2.0.7, org.apache.maven:maven-plugin-registry:jar:2.0
.7, org.apache.maven:maven-plugin-descriptor:jar:2.0.7, org.apache.maven:maven-a
rtifact-manager:jar:2.0.7, org.apache.maven:maven-monitor:jar:2.0.7, classworlds
:classworlds:jar:1.1: Could not transfer artifact org.apache.maven:maven-core:ja
r:2.0.7 from/to adobe (http://repo.adobe.com/nexus/content/groups/public/): sun.
security.validator.ValidatorException: PKIX path building failed: sun.security.p
rovider.certpath.SunCertPathBuilderException: unable to find valid certification
 path to requested target @
[ERROR] Unknown packaging: bundle @ com.lundbeck.master.nohmatters:nohmatters-bu
ndle:[unknown-version], D:\CODEBASE\nohmatters\bundle\pom.xml, line 19, column 1
6
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.lundbeck.master.nohmatters:nohmatters-bundle:1.0.0-SNA
PSHOT (D:\CODEBASE\nohmatters\bundle\pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin org.apache.felix:maven-bundle-
plugin:2.3.7 or one of its dependencies could not be resolved: The following art
ifacts could not be resolved: org.apache.maven:maven-core:jar:2.0.7, org.apache.
maven:maven-settings:jar:2.0.7, org.apache.maven:maven-plugin-parameter-document
er:jar:2.0.7, org.apache.maven:maven-profile:jar:2.0.7, org.apache.maven:maven-m
odel:jar:2.0.7, org.apache.maven:maven-artifact:jar:2.0.7, org.codehaus.plexus:p
lexus-container-default:jar:1.0-alpha-9-stable-1, org.apache.maven:maven-reposit
ory-metadata:jar:2.0.7, org.apache.maven:maven-error-diagnostics:jar:2.0.7, org.
apache.maven:maven-project:jar:2.0.7, org.apache.maven:maven-plugin-registry:jar
:2.0.7, org.apache.maven:maven-plugin-descriptor:jar:2.0.7, org.apache.maven:mav
en-artifact-manager:jar:2.0.7, org.apache.maven:maven-monitor:jar:2.0.7, classwo
rlds:classworlds:jar:1.1: Could not transfer artifact org.apache.maven:maven-cor
e:jar:2.0.7 from/to adobe (http://repo.adobe.com/nexus/content/groups/public/):
sun.security.validator.ValidatorException: PKIX path building failed: sun.securi
ty.provider.certpath.SunCertPathBuilderException: unable to find valid certifica
tion path to requested target -> [Help 2]

[ERROR]     Unknown packaging: bundle @ com.lundbeck.master.nohmatters:nohmatter
s-bundle:[unknown-version], D:\CODEBASE\nohmatters\bundle\pom.xml, line 19, colu
mn 16

my pom.xml is as following:

我砰的一声。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/maven-v4_0_0.xsd ">
    <modelVersion>4.0.0</modelVersion>
    <!-- ====================================================================== -->
    <!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
    <!-- ====================================================================== -->
    <parent>
        <groupId>com.lundbeck.master.nohmatters</groupId>
        <artifactId>nohmatters</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <!-- ====================================================================== -->
    <!-- P R O J E C T D E S C R I P T I O N -->
    <!-- ====================================================================== -->

    <artifactId>nohmatters-bundle</artifactId>
    <packaging>bundle</packaging>
    <name>nohmatters Bundle</name>

    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>biz.aQute</groupId>
            <artifactId>bndlib</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
        </dependency>
         <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.jcr.api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.day.cq.wcm</groupId>
            <artifactId>cq-wcm-workflow-api</artifactId>
            <version>5.3.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.day.cq.wcm</groupId>
            <artifactId>cq-wcm-api</artifactId>
            <version>5.5.0</version>
        </dependency>
        <dependency>
            <groupId>com.day.cq</groupId>
            <artifactId>cq-commons</artifactId>
            <version>5.5.0</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.json</artifactId>
            <version>2.0.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.day.cq</groupId>
            <artifactId>cq-mailer</artifactId>
            <version>5.5.0</version>
         </dependency>
          <dependency>
            <groupId>com.day.cq</groupId>
            <artifactId>cq-search</artifactId>
            <version>5.5.4</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.granite</groupId>
            <artifactId>com.adobe.granite.xssprotection</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.resourceresolver</artifactId>
        </dependency>
        <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.api</artifactId>
                <version>2.9.0</version>
                <scope>provided</scope>
            </dependency>   
            <dependency>
                        <groupId>com.itextpdf</groupId>
                        <artifactId>itextpdf</artifactId>
                        <version>5.5.6</version>
                </dependency>
                <dependency>
                        <groupId>com.itextpdf.tool</groupId>
                        <artifactId>xmlworker</artifactId>
                        <version>5.5.6</version>
                </dependency>
                <dependency>
           <groupId>com.jcraft</groupId>
           <artifactId>jsch</artifactId>
           <version>0.1.53</version>
           <scope>compile</scope>
        </dependency>
            <dependency>
    <groupId>com.jcraft</groupId>
    <artifactId>jzlib</artifactId>
    <version>1.1.3</version>
</dependency>
 <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-io</artifactId>
    <version>1.3.2</version>
</dependency>
<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.3</version>
</dependency>
<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <version>6.1.0</version>
    <classifier>obfuscated-apis</classifier>
    <scope>provided</scope>
</dependency>
    </dependencies>

    <!-- ====================================================================== -->
    <!-- B U I L D D E F I N I T I O N -->
    <!-- ====================================================================== -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-scr-descriptor</id>
                        <goals>
                            <goal>scr</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>com.lundbeck.master.nohmatters.nohmatters-bundle</Bundle-SymbolicName>
                        <Import-Package>org.osgi.framework,*</Import-Package>
                        <Export-Package>com.lundbeck.master.nohmatters.*,com.lundbeck.master.nohmatters.servlet.EmailServlet,com.jcraft.*;com.jcraft.jzlib</Export-Package>
                        <Include-Resource>{maven-resources}</Include-Resource>
                        <Import-Bundle>*</Import-Bundle>
                        <Embed-Dependency>gson</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                        <Private-Package>com.lundbeck.master.nohmatters.servlet.*,com.jcraft.*</Private-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>maven-sling-plugin</artifactId>
                <configuration>
                    <slingUrl>http://${crx.host}:${crx.port}/apps/nohmatters/install</slingUrl>
                    <usePut>true</usePut>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                 <configuration>
                    <excludePackageNames>
                        *.impl
                    </excludePackageNames>
                 </configuration>
            </plugin>
        </plugins>
    </build>
</project>
<?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/maven-v4_0_0.xsd ">
    <modelVersion>4.0.0</modelVersion>
    <!-- ====================================================================== -->
    <!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
    <!-- ====================================================================== -->
    <parent>
        <groupId>com.lundbeck.master.nohmatters</groupId>
        <artifactId>nohmatters</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <!-- ====================================================================== -->
    <!-- P R O J E C T D E S C R I P T I O N -->
    <!-- ====================================================================== -->

    <artifactId>nohmatters-bundle</artifactId>
    <packaging>bundle</packaging>
    <name>nohmatters Bundle</name>

    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>biz.aQute</groupId>
            <artifactId>bndlib</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
        </dependency>
         <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.jcr.api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.day.cq.wcm</groupId>
            <artifactId>cq-wcm-workflow-api</artifactId>
            <version>5.3.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.day.cq.wcm</groupId>
            <artifactId>cq-wcm-api</artifactId>
            <version>5.5.0</version>
        </dependency>
        <dependency>
            <groupId>com.day.cq</groupId>
            <artifactId>cq-commons</artifactId>
            <version>5.5.0</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.json</artifactId>
            <version>2.0.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.day.cq</groupId>
            <artifactId>cq-mailer</artifactId>
            <version>5.5.0</version>
         </dependency>
          <dependency>
            <groupId>com.day.cq</groupId>
            <artifactId>cq-search</artifactId>
            <version>5.5.4</version>
        </dependency>
        <dependency>
            <groupId>com.adobe.granite</groupId>
            <artifactId>com.adobe.granite.xssprotection</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.resourceresolver</artifactId>
        </dependency>
        <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.api</artifactId>
                <version>2.9.0</version>
                <scope>provided</scope>
            </dependency>   
            <dependency>
                        <groupId>com.itextpdf</groupId>
                        <artifactId>itextpdf</artifactId>
                        <version>5.5.6</version>
                </dependency>
                <dependency>
                        <groupId>com.itextpdf.tool</groupId>
                        <artifactId>xmlworker</artifactId>
                        <version>5.5.6</version>
                </dependency>
                <dependency>
           <groupId>com.jcraft</groupId>
           <artifactId>jsch</artifactId>
           <version>0.1.53</version>
           <scope>compile</scope>
        </dependency>
            <dependency>
    <groupId>com.jcraft</groupId>
    <artifactId>jzlib</artifactId>
    <version>1.1.3</version>
</dependency>
 <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-io</artifactId>
    <version>1.3.2</version>
</dependency>
<dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.3</version>
</dependency>
<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <version>6.1.0</version>
    <classifier>obfuscated-apis</classifier>
    <scope>provided</scope>
</dependency>
    </dependencies>

    <!-- ====================================================================== -->
    <!-- B U I L D D E F I N I T I O N -->
    <!-- ====================================================================== -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-scr-descriptor</id>
                        <goals>
                            <goal>scr</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>com.lundbeck.master.nohmatters.nohmatters-bundle</Bundle-SymbolicName>
                        <Import-Package>org.osgi.framework,*</Import-Package>
                        <Export-Package>com.lundbeck.master.nohmatters.*,com.lundbeck.master.nohmatters.servlet.EmailServlet,com.jcraft.*;com.jcraft.jzlib</Export-Package>
                        <Include-Resource>{maven-resources}</Include-Resource>
                        <Import-Bundle>*</Import-Bundle>
                        <Embed-Dependency>gson</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                        <Private-Package>com.lundbeck.master.nohmatters.servlet.*,com.jcraft.*</Private-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>maven-sling-plugin</artifactId>
                <configuration>
                    <slingUrl>http://${crx.host}:${crx.port}/apps/nohmatters/install</slingUrl>
                    <usePut>true</usePut>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                 <configuration>
                    <excludePackageNames>
                        *.impl
                    </excludePackageNames>
                 </configuration>
            </plugin>
        </plugins>
    </build>
</project>

2 个解决方案

#1


0  

The dependency must contain the all of the 3 required parameter so that it can download the exact jar.

依赖项必须包含3个必需的参数,以便它能够下载精确的jar。

As the error mentioned here is the

正如这里提到的错误。

Plugin org.apache.felix:maven-bundle-plug in:2.3.7 or one of its dependencies could not be resolved

插件表示。在:2.3.7或它的一个依赖项无法解决。

This is because you haven't provided the version that you want to download.

这是因为您还没有提供您想要下载的版本。

<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
</dependency>

Try this it will provide you the exact maven bundle plugin 2.3.7

尝试一下,它将为您提供精确的maven bundle plugin 2.3.7。

http://mvnrepository.com/artifact/org.apache.felix/maven-bundle-plugin/2.3.7

http://mvnrepository.com/artifact/org.apache.felix/maven-bundle-plugin/2.3.7

#2


0  

you need to check whether your maven private repository is ok. If you don't use private repository, you need to whether your maven central repository.

您需要检查maven私有存储库是否正常。如果不使用私有存储库,则需要考虑maven*存储库。

Usually, you will configure your private maven repository in ~/.m2/settings.xml 。 https://maven.apache.org/settings.html#Repositories

通常,您将在~/.m2/设置中配置您的私有maven存储库。xml。https://maven.apache.org/settings.html存储库

for example:

例如:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

无法计算构建计划:插件org.apache.m .plugins:maven-resources-plugin:2.5或其中一个依赖项无法解决?

#1


0  

The dependency must contain the all of the 3 required parameter so that it can download the exact jar.

依赖项必须包含3个必需的参数,以便它能够下载精确的jar。

As the error mentioned here is the

正如这里提到的错误。

Plugin org.apache.felix:maven-bundle-plug in:2.3.7 or one of its dependencies could not be resolved

插件表示。在:2.3.7或它的一个依赖项无法解决。

This is because you haven't provided the version that you want to download.

这是因为您还没有提供您想要下载的版本。

<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
</dependency>

Try this it will provide you the exact maven bundle plugin 2.3.7

尝试一下,它将为您提供精确的maven bundle plugin 2.3.7。

http://mvnrepository.com/artifact/org.apache.felix/maven-bundle-plugin/2.3.7

http://mvnrepository.com/artifact/org.apache.felix/maven-bundle-plugin/2.3.7

#2


0  

you need to check whether your maven private repository is ok. If you don't use private repository, you need to whether your maven central repository.

您需要检查maven私有存储库是否正常。如果不使用私有存储库,则需要考虑maven*存储库。

Usually, you will configure your private maven repository in ~/.m2/settings.xml 。 https://maven.apache.org/settings.html#Repositories

通常,您将在~/.m2/设置中配置您的私有maven存储库。xml。https://maven.apache.org/settings.html存储库

for example:

例如:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

无法计算构建计划:插件org.apache.m .plugins:maven-resources-plugin:2.5或其中一个依赖项无法解决?