使用Maven

时间:2016-07-12 04:53:46

标签: maven soa jdeveloper oracle-soa

我正在尝试使用Maven3.2.5构建我的SOA 12.2.1.0.0项目并使用默认的Maven本地存储库。我已完成以下步骤: 1.将Maven同步插件安装到本地存储库(mvn install) 2.使用Push目标将所有必需的库推送到本地存储库 3.更新原型以反映新安装的库。

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

  

1.0-SNAPSHOT:无法在com.oracle.adf.library收集依赖项:BC4J-Service-Runtime:pom:12.2.1-0-0' '无   可用的版本   com.oracle.legacy_oc4j_xml_schemas:com.oracle.webservices.fmw.web-共架构 - IMPL:罐:[12.2.1,12.2.2)   在指定范围内

存储库的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>

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

2 个答案:

答案 0 :(得分:1)

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

如果我正确理解您的问题,您可以在某处提供Oracle库(很可能是JAR),因此您不希望Maven将这些库包含在您的包装中。但是当你指出<type>pom</type>时,Maven试图获得这些家属的POM并且它不起作用。

答案 1 :(得分:0)

这个问题已经解决了。因为并非所有依赖的jar都是使用PUSH命令安装的(原因未知)。经过几次试验(删除并重新执行命令)后,所有的jar都安装了,现在全部目标正在成功地执行。 谢谢你的帮助!