2016-09-23 73 views
1

我有一個編譯和部署沒有任何問題的maven項目。我正在嘗試使用該版本:準備目標,但出現錯誤。我已經搜索並理解插件可以給予前綴,錯誤意味着它找不到一個前綴爲'C'的插件。我不知道爲什麼它正在尋找一個帶有這個前綴的插件。maven版本:準備給出[錯誤]沒有在當前項目中找到前綴'C'的插件

我的POM文件是:

<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> 

    <scm> 
    <connection>scm:git:ssh://[email protected]:rmetcalf9/ICSchema_SAMPLE_UTIL_SCHEMA.git</connection> 
    <url>ssh://[email protected]:rmetcalf9/ICSchema_SAMPLE_UTIL_SCHEMA.git</url> 
    <tag>ICSchema_SAMPLE_UTIL_SCHEMA-0.0.1</tag> 
    </scm> 

    <groupId>metcarob.com.oracledb.sample.schema</groupId> 
    <artifactId>ICSchema_SAMPLE_UTIL_SCHEMA</artifactId> 
    <version>0.0.1</version> 
    <packaging>jar</packaging> 

    <name>ICSchema_SAMPLE_UTIL_SCHEMA</name> 
    <url>http://maven.apache.org</url> 

<!-- 
Command line parameters: 
    cmd.env  - the environment this project is to be deployed to (dev/test/prod/etc) 
    cmd.parent.sys (OPTIONAL) - for UTILITY schemas this designates the system to use for deployment. 
         this is overridden by the pom property ic.pom.sys if present 
--> 

    <properties> 
    <ic.ci.deployment.type>OracleDB</ic.ci.deployment.type> 
    <ic.ci.resourcedir>${project.basedir}/src/main/resources</ic.ci.resourcedir> 
    <ic.db.ciuser>CIDBADMIN</ic.db.ciuser> 
    <ic.db.ciuserpass>PASSWORD_REMOVED_FROM_POST</ic.db.ciuserpass> 
    <ic.db.schema.name>SAMPLE_UTIL_SCHEMA</ic.db.schema.name> 
    <ic.db.schema.objecttable>schema_objects</ic.db.schema.objecttable> 
    <ic.db.sqlplus.connectstring>${ic.db.ciuser}/${ic.db.ciuserpass}@${ic.db.host}:${ic.db.port}/${ic.db.service_name}</ic.db.sqlplus.connectstring> 
    <ic.db.jdbc.connectstring>jdbc:oracle:thin:@(DESCRIPTION=(enable=broken)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=${ic.db.host})(PORT=${ic.db.port})))(CONNECT_DATA=(service_name=${ic.db.service_name})))</ic.db.jdbc.connectstring> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  

    </properties> 

    <distributionManagement> 
    <snapshotRepository> 
     <id>ssh-repository</id> 
      <name>ssh-repository</name> 
     <url>scpexe://mvn.metcarob.com:7456/public_snapshots</url> 
    </snapshotRepository> 
    <repository> 
     <id>ssh-repository</id> 
      <name>ssh-repository</name> 
     <url>scpexe://mvn.metcarob.com:7456/public</url> 
    </repository> 
    </distributionManagement> 

    <repositories> 
    <repository> 
     <id>ic_snapshot</id> 
     <url>https://mvnsnap.metcarob.com</url> 
    </repository> 
    <repository> 
     <id>ic_main</id> 
     <url>https://mvn.metcarob.com</url> 
    </repository> 
    </repositories> 


    <build> 
     <plugins>  
      <!-- First plugin will caculate the sys property --> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>build-helper-maven-plugin</artifactId> 
       <version>1.10</version> 
       <executions> 
       <execution> 
        <id>bsh-property</id> 
        <goals> 
        <goal>bsh-property</goal> 
        </goals> 
        <configuration> 
        <properties> 
         <property>ic.actual.sys</property> 
        </properties> 
        <source> 
         ic.actual.sys = project.getProperties().getProperty("ic.pom.sys", session.getUserProperties().getProperty("cmd.parent.sys")); 
        </source> 
        </configuration> 
       </execution> 
       </executions> 
      </plugin>  
      <!-- Second plugin will read property values at the start of the validate phase --> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>properties-maven-plugin</artifactId> 
       <version>1.0-alpha-2</version> 
       <executions> 
        <execution> 
        <phase>validate</phase> 
        <goals> 
         <goal>read-project-properties</goal> 
        </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <files> 
        <file>${env.CIICENV_HOME}/${cmd.env}/${ic.actual.sys}.properties</file> 
        </files> 
       </configuration> 
       </plugin> 

       <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>exec-maven-plugin</artifactId> 
       <version>1.5.0</version> 
       <executions> 
        <execution> 
        <id>deploy-dependancies</id> 
        <phase>validate</phase> 
        <goals> 
         <goal>exec</goal> 
        </goals> 
        <configuration> 
         <executable>ci_deployer</executable> 
         <arguments> 
         <argument>${project.basedir}/pom.xml</argument> 
         <argument>NULL</argument> 
         <argument>${cmd.env}</argument> 
         <argument>${ic.actual.sys}</argument> 
         </arguments> 
         <workingDirectory>${ic.ci.resourcedir}</workingDirectory> 
        </configuration> 
        </execution> 


        <execution> 
        <id>pre-hook</id> 
        <phase>compile</phase> 
        <goals> 
         <goal>exec</goal> 
        </goals> 
        <configuration> 
         <executable>sqlplus</executable> 
         <arguments> 
         <argument>${ic.db.sqlplus.connectstring}</argument> 
         <argument>as</argument> 
         <argument>sysdba</argument> 
         <argument>@_control.sql</argument> 
         <argument>${ic.db.schema.name}</argument> 
         </arguments> 
         <workingDirectory>${ic.ci.resourcedir}/db/pre_migration</workingDirectory> 
        </configuration> 
        </execution> 
        <execution> 
        <id>sqlcodedeploy-setup</id> 
        <phase>compile</phase> 
        <goals> 
         <goal>exec</goal> 
        </goals> 
        <configuration> 
         <executable>sqlcodedeploy_setup</executable> 
         <arguments> 
         <argument>${ic.ci.resourcedir}/db/code</argument> 
         <argument>${ic.db.sqlplus.connectstring}</argument> 
         <argument>${ic.db.schema.name}</argument> 
         <argument>${project.version}</argument> 
         <argument>${ic.db.schema.objecttable}</argument> 
         </arguments> 
         <workingDirectory>${ic.ci.resourcedir}/db/code</workingDirectory> 
        </configuration> 
        </execution>     
        <execution> 
        <id>migrate-datastructures</id> 
        <phase>compile</phase> 
        <goals> 
         <goal>exec</goal> 
        </goals> 
        <configuration> 
         <executable>ci_flyway</executable> 
         <arguments> 
         <argument>"${ic.db.jdbc.connectstring}"</argument> 
         <argument>"${ic.db.ciuser}"</argument> 
         <argument>"${ic.db.ciuserpass}"</argument> 
         <argument>"${ic.db.schema.name}"</argument> 
         <argument>"${ic.ci.resourcedir}/db/migration"</argument> 
         </arguments> 
         <workingDirectory>${ic.ci.resourcedir}</workingDirectory> 
        </configuration> 
        </execution> 
        <execution> 
        <id>deploy-code</id> 
        <phase>compile</phase> 
        <goals> 
         <goal>exec</goal> 
        </goals> 
        <configuration> 
         <executable>sqlcodedeploy</executable> 
         <arguments> 
         <argument>${ic.ci.resourcedir}/db/code</argument> 
         <argument>${ic.db.sqlplus.connectstring}</argument> 
         <argument>${ic.db.schema.name}</argument> 
         <argument>${project.version}</argument> 
         <argument>${ic.db.schema.objecttable}</argument> 
         </arguments> 
         <workingDirectory>${ic.ci.resourcedir}/db/code</workingDirectory> 
        </configuration> 
        </execution> 

        <execution> 
        <id>sqlplusmulti-runtests</id> 
        <phase>test</phase> 
        <goals> 
         <goal>exec</goal> 
        </goals> 
        <configuration> 
         <executable>sqlplusmulti</executable> 
         <arguments> 
         <argument>${project.basedir}/src/test/resources/db/code</argument> 
         <argument>${ic.db.sqlplus.connectstring}</argument> 
         <argument>${ic.db.schema.name}</argument> 
         <argument>*.sql</argument> 
         </arguments> 
         <workingDirectory>${project.basedir}/src/test/resources/db/code</workingDirectory> 
        </configuration> 
        </execution>     

       </executions> 
       </plugin> 

     </plugins> 

     <extensions> 
      <!-- Enabling the use of SSH --> 
      <extension> 
      <groupId>org.apache.maven.wagon</groupId> 
      <artifactId>wagon-ssh-external</artifactId> 
      <version>2.10</version> 
      </extension> 
     </extensions>   
    </build> 
</project> 

我用命令MVN -X釋放:準備-Dcmd.env =開發-Dcmd.parent.sys = SOA來運行它,並輸出過大,該職位但相關的部分是:

INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 43.2 KB/sec) 
[INFO] [DEBUG] Writing tracking file C:\off_desk\eclipse_workspaces\CITesting\ICSchema_SAMPLE_UTIL_SCHEMA\true\org\apache\maven\plugins\resolver-status.properties 
[INFO]      
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 66.9 KB/sec) 
[INFO] [DEBUG] Writing tracking file C:\off_desk\eclipse_workspaces\CITesting\ICSchema_SAMPLE_UTIL_SCHEMA\true\org\codehaus\mojo\resolver-status.properties 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] BUILD FAILURE 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [INFO] Total time: 0.890 s 
[INFO] [INFO] Finished at: 2016-09-23T12:39:47+01:00 
[INFO] [INFO] Final Memory: 12M/304M 
[INFO] [INFO] ------------------------------------------------------------------------ 
[INFO] [ERROR] No plugin found for prefix 'C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\off_desk\eclipse_workspaces\CITesting\ICSchema_SAMPLE_UTIL_SCHEMA\true), central (https://repo.maven.apache.org/maven2)] -> [Help 1] 
[INFO] org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\off_desk\eclipse_workspaces\CITesting\ICSchema_SAMPLE_UTIL_SCHEMA\true), central (https://repo.maven.apache.org/maven2)] 
[INFO] at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:93) 
[INFO] at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:265) 
[INFO] at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:219) 
[INFO] at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:103) 
[INFO] at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:83) 
[INFO] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:89) 
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
[INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
[INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
[INFO] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
[INFO] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
[INFO] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
[INFO] at java.lang.reflect.Method.invoke(Method.java:497) 
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 
[INFO] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
[INFO] [ERROR] 
[INFO] [ERROR] 
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles: 
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Skipping ICSchema_SAMPLE_UTIL_SCHEMA 
[INFO] This project has been banned from the build due to previous failures. 
[INFO] ------------------------------------------------------------------------ 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.663 s 
[INFO] Finished at: 2016-09-23T12:39:47+01:00 
[INFO] Final Memory: 13M/309M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project ICSchema_SAMPLE_UTIL_SCHEMA: Maven execution failed, exit code: '1' -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project ICSchema_SAMPLE_UTIL_SCHEMA: Maven execution failed, exit code: '1' 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
Caused by: org.apache.maven.plugin.MojoExecutionException: Maven execution failed, exit code: '1' 
    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:295) 
    at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:247) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 
    ... 20 more 
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Maven execution failed, exit code: '1' 
    at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:89) 
    at org.apache.maven.shared.release.phase.RunPrepareGoalsPhase.execute(RunPrepareGoalsPhase.java:44) 
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:234) 
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:169) 
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:146) 
    at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:107) 
    at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:291) 
    ... 23 more 
Caused by: org.apache.maven.shared.release.exec.MavenExecutorException: Maven execution failed, exit code: '1' 
    at org.apache.maven.shared.release.exec.InvokerMavenExecutor.executeGoals(InvokerMavenExecutor.java:409) 
    at org.apache.maven.shared.release.exec.AbstractMavenExecutor.executeGoals(AbstractMavenExecutor.java:85) 
    at org.apache.maven.shared.release.phase.AbstractRunGoalsPhase.execute(AbstractRunGoalsPhase.java:81) 
    ... 29 more 
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 

這有「沒有找到前綴C插件」。 有沒有人有任何建議,在哪裏尋找縮小的原因?

我試過註釋掉所有來自pom的插件,我仍然得到相同的錯誤。

+0

你推出什麼Maven的命令? – Tunaki

+0

mvn -X發行版:準備-Dcmd.env dev -Dcmd.parent.sys soa – Robert3452

+1

傳遞值時缺少'=',也許這是問題所在? – Tunaki

回答

1

我的問題是由我推出maven的方式造成的。我在中央批處理目錄中爲它創建了批處理腳本。這工作爲

mvn package 
mvn deploy 
etc. 

但不是釋放插件。

我不得不把maven放在我的路上。我收到另一個錯誤,抱怨maven找不到mvn.bat。我看着在Maven目錄

C:\Program Files\Apache\apache-maven-3.3.9\bin 

,我發現 「MVN」 和 「mvn.cmd」,但沒有 「mvn.bat」。 我將「mvn.cmd」複製到「mvn.bat」,現在它似乎工作。

然後我發現我的論點被忽略了。我發現我需要調用MVN以一種奇怪的方式,使工作參數:

mvn release:prepare -Darguments="-Dcmd.env=dev -Dcmd.parent.sys=soa" 

最後它的工作。 (好吧,我正在調試git相關問題) 感謝大家的幫助

0

我認爲這是將參數傳遞給release插件的正確方法。 否則釋放插件會忽略屬性的值。

或者在你的POM文件,在行家釋放小插件的配置,你應該有: $ {} releaseParams或 -Dparam = $值-Dparam = $值

相關問題