0

我想安装oracle插件--ojdbc6.jar。当我运行这些命令时:

cd D:\sakai3\nakamura\contrib\oracle-jdbc-6
mvn install:install-file -DgroupId=com.oracle-jdbc-6 -DartifactId=ojdbc6 -Dversion=10.2.0.1.0 -Dpackaging=jar -Dfile=org.sakaiproject.nakamura.ojdbc.jar
mvn -P 10.2.0.1.0 clean install
cd D:\sakai3\nakamura
mvn clean install
cd D:\sakai3\nakamura\contrib\csu
mvn clean package

当我运行最后一个命令时,出现此错误:

[ERROR] Failed to execute goal on project edu.nyu.launchpad: Could not resolve d
ependencies for project edu.nyu:edu.nyu.launchpad:jar:1.4.2: The following artif
acts could not be resolved: org.apache.sling:maven-launchpad-plugin:jar:app:2.1.
0, org.sakaiproject.nakamura:org.sakaiproject.nakamura.ojdbc:jar:app:1.4.0, edu.
nyu:edu.nyu.launchpad:jar:app:1.4.2: Could not find artifact org.apache.sling:ma
ven-launchpad-plugin:jar:app:2.1.0 in maven repo (http://repo1.maven.org/maven2/
) -> [Help 1]

这是我的pom:

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.sakaiproject.nakamura</groupId>
        <artifactId>base</artifactId>
        <version>1.4.2</version>
    </parent>

    <groupId>edu.nyu</groupId>
    <artifactId>edu.nyu.launchpad</artifactId>
    <name>NYU Launchpad</name>

    <properties>
        <nakamura.version>1.4.0</nakamura.version>
        <ux.version>1.4.0</ux.version>
    </properties>

    <packaging>jar</packaging>

    <build>
        <resources>
            <resource>
                <directory>../../app/src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>maven-launchpad-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-package</id>
                        <goals>
                            <goal>prepare-package</goal>
                        </goals>
                        <configuration>
                            <defaultBundleList>
                                <groupId>org.sakaiproject.nakamura</groupId>
                                <artifactId>org.sakaiproject.nakamura.app</artifactId>
                                <version>${nakamura.version}</version>
                            </defaultBundleList>
                            <jarWebSupport>
                                <groupId>org.sakaiproject.nakamura</groupId>
                                <artifactId>org.sakaiproject.nakamura.jetty-config</artifactId>
                                <version>${nakamura.version}</version>
                                <startLevel>5</startLevel>
                            </jarWebSupport>
                            <additionalBundles>
                                <bundle>
                                    <groupId>org.sakaiproject.nakamura</groupId>
                                    <artifactId>org.sakaiproject.nakamura.ojdbc6</artifactId>
                                    <version>${nakamura.version}</version>
                                    <startLevel>1</startLevel>
                                </bundle>
                                <bundle>
                                    <groupId>org.sakaiproject.nakamura</groupId>
                                    <artifactId>org.sakaiproject.nakamura.uxloader</artifactId>
                                    <version>${ux.version}</version>
                                    <startLevel>30</startLevel> </bundle>
                            </additionalBundles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.launchpad.base</artifactId>
            <version>2.3.0</version>
            <classifier>webapp</classifier>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>maven-launchpad-plugin</artifactId>
            <version>2.1.0</version>
            <classifier>app</classifier>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

我对我的英语感到非常抱歉。我是中国人。请原谅我蹩脚的英文和不清楚的表达。对不起!谢谢!

4

1 回答 1

1

首先,您可以删除对maven-launchpad-plugin. 我根本看不出有任何合理的理由将其捆绑在一起。还是我错过了什么?你得到的错误很清楚:

Could not find artifact org.apache.sling:maven-launchpad-plugin:jar:app:2.1.0

该插件在您的构建过程中使用,不需要作为依赖项。删除以下内容:

<dependency>
    <groupId>org.apache.sling</groupId>
    <artifactId>maven-launchpad-plugin</artifactId>
    <version>2.1.0</version>
    <classifier>app</classifier>
    <scope>provided</scope>
</dependency>

作为一个侧面标记​​,您不应该像这样在项目之外获取资源:

<resources>
    <resource>
        <directory>../../app/src/main/resources</directory>
    </resource>
</resources>

资源应包含在项目中。

于 2012-10-30T09:40:04.717 回答