使用 Maven 编译 SOA 12C 项目时出现问题

Issue in Compiling SOA 12C project with Maven

我正在尝试使用 Maven3.2.5 构建我的 SOA 12.2.1.0.0 项目并使用默认的 Maven local repository.I 完成了以下步骤: 1.Installed Maven同步插件到本地respository(mvn install) 2.Pushed 使用 Push 目标将所有需要的库添加到本地存储库 3.Updated 反映新安装的库的原型。

当我尝试使用 Maven 编译项目时,出现以下错误:

1.0-SNAPSHOT: Failed to collect dependencies at com.oracle.adf.library:BC4J-Service-Runtime:pom:12.2.1-0-0' 'No versions available for com.oracle.legacy_oc4j_xml_schemas:com.oracle.webservices.fmw.web-common-schemas-impl:jar:[12.2.1,12.2.2) within specified range

存储库的 com.oracle.legacy_oc4j_xml_schemas 包含一个文件夹(com.oracle.webservices.fmw.web-common-schemas-impl)和一个文件 resolver-status.properties 具有以下内容:

maven-metadata-central.xml.error=  
maven-metadata-central.xml.lastUpdated=1468297090681  

下面是有效的pom:

 <?xml version="1.0" encoding="UTF-8"?>
    <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <parent>
    <groupId>com.oracle.soa</groupId>
    <artifactId>sar-common</artifactId>
    <version>12.2.1-0-0</version>
    <relativePath></relativePath>
    </parent>
    <groupId>MavenIntegrationApplication</groupId>
    <artifactId>TestProjectMaven</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>sar</packaging>
    <description>Oracle FMW Common Parent POM</description>
    <url>http://www.oracle.com/us/products/middleware/overview/index.html/sar-common/TestProjectMaven</url>
    <inceptionYear>2012</inceptionYear>
    <properties>
    <password></password>
    <scac.input>D:\JDEVWorkspace-12C\TestProjectMaven/SOA//composite.xml</scac.input>
    <oraclePassword></oraclePassword>
    <overwrite>true</overwrite>
    <composite.partition>default</composite.partition>
    <regenerateRulebase>false</regenerateRulebase>
    <scac.error>D:\JDEVWorkspace-12C\TestProjectMaven/target/error.txt</scac.error>
    <oracleServerUrl>http://localhost:7003</oracleServerUrl>
    <scac.output.dir>D:\JDEVWorkspace-12C\TestProjectMaven/target</scac.output.dir>
    <composite.revision>1.0</composite.revision>
    <oracleHome>${env.ORACLE_HOME}</oracleHome>
    <forceDefault>true</forceDefault>
    <scac.displayLevel>1</scac.displayLevel>
    <composite.name>TestProjectMaven</composite.name>
    <input>TestProjectMaven</input>
    <keepInstancesOnRedeploy>false</keepInstancesOnRedeploy>
    <scac.output>D:\JDEVWorkspace-12C\TestProjectMaven/target/out.xml</scac.output>
    <scac.input.dir>D:\JDEVWorkspace-12C\TestProjectMaven/SOA/</scac.input.dir>
    <oracleServerName>soa_server1</oracleServerName>
    <oracleUsername></oracleUsername>
    <serverUrl>http://localhost:7003</serverUrl>
    <scatest.result>D:\JDEVWorkspace-12C\TestProjectMaven/target/testResult</scatest.result>
    <oracleMiddlewareHome>/home/myhome/Oracle/Middleware</oracleMiddlewareHome>
    <user></user>
    </properties>
    <dependencies>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>SOA-Designtime</artifactId>
      <version>12.2.1-0-0</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>SOA-Runtime</artifactId>
      <version>12.2.1-0-0</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>BPEL-Runtime</artifactId>
      <version>12.2.1-0-0</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>Mediator-Runtime</artifactId>
      <version>12.2.1-0-0</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.adf.library</groupId>
      <artifactId>MDS-Runtime</artifactId>
      <version>12.2.1-0-0</version>
      <type>pom</type>
      <scope>provided</scope>
    </dependency>
    </dependencies>
    <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
    </pluginRepository>
  </pluginRepositories>
  <build>
    <sourceDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\src\main\java</sourceDirectory>
    <scriptSourceDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\src\main\scripts</scriptSourceDirectory>
    <testSourceDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\src\test\java</testSourceDirectory>
    <outputDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\target\classes</outputDirectory>
    <testOutputDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\target\test-classes</testOutputDirectory>
    <resources>
      <resource>
        <directory>D:\JDEVWorkspace-12C\TestProjectMaven\src\main\resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>D:\JDEVWorkspace-12C\TestProjectMaven\src\test\resources</directory>
      </testResource>
    </testResources>
    <directory>D:\JDEVWorkspace-12C\TestProjectMaven\target</directory>
    <finalName>TestProjectMaven-1.0-SNAPSHOT</finalName>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.3</version>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.2-beta-5</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.8</version>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.3.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.oracle.soa.plugin</groupId>
        <artifactId>oracle-soa-plugin</artifactId>
        <version>12.2.1-0-0</version>
        <extensions>true</extensions>
        <configuration>
          <compositeName>TestProjectMaven</compositeName>
          <composite>D:\JDEVWorkspace-12C\TestProjectMaven/SOA//composite.xml</composite>
          <sarLocation>D:\JDEVWorkspace-12C\TestProjectMaven/target/sca_TestProjectMaven_rev1.0-SNAPSHOT.jar</sarLocation>
          <serverUrl>http://localhost:7003</serverUrl>
          <user></user>
          <password></password>
          <compositeRevision>1.0</compositeRevision>
          <revision>1.0</revision>
          <scacInputDir>D:\JDEVWorkspace-12C\TestProjectMaven/SOA/</scacInputDir>
          <input>TestProjectMaven</input>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.oracle.maven</groupId>
        <artifactId>oracle-maven-sync</artifactId>
        <version>12.2.1-0-0</version>
        <configuration>
          <serverId>internal</serverId>
          <oracleHome>D:\OracleSOA12C\Oracle_Home</oracleHome>
          <testOnly>false</testOnly>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.oracle.adf.plugin</groupId>
        <artifactId>ojdeploy</artifactId>
        <version>12.2.1-0-0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <ojdeploy>${env.ORACLE_HOME}/jdeveloper/jdev/bin/ojdeploy.exe</ojdeploy>
          <workspace>D:\JDEVWorkspace-12C\TestProjectMaven/../MavenIntegrationApplication.jws</workspace>
          <project>TestProjectMaven</project>
          <profile>TestProjectMaven</profile>
          <outputfile>D:\JDEVWorkspace-12C\TestProjectMaven\target/TestProjectMaven-1.0-SNAPSHOT.jar</outputfile>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <outputDirectory>D:\JDEVWorkspace-12C\TestProjectMaven\target\site</outputDirectory>
  </reporting>
</project>

如果我错过了一些步骤,有人可以帮我解决这个问题吗?

我认为您应该删除 <type>pom</type> 个依赖项。

如果我对您的问题的理解正确,您在某处提供了 Oracle 库(很可能是 JAR),因此您不希望 Maven 将这些库包含在您的打包中。但是正如您指出的那样 <type>pom</type>,Maven 正在尝试获取这些依赖项的 POM,但没有成功。

这个问题 resolved.It 是因为并非所有依赖的 jar 都使用 PUSH 命令安装(原因未知)。经过更多的试验(删除并重新执行命令),所有的 jar 都安装了并且现在所有的目标都成功执行了。 感谢大家的帮助!