2016-04-15 11 views
0

pom.xmlファイルからGradleビルドを初期化しようとしています。以下の構造が作成されましたが、私はbuid.gradleが見つからないことに気付きました。Gradle initはpomからビルドを生成しません

my-project 
-- gradle 
---- wrapper 
------ gradle-wrapper.jar 
------ gradle-wrapper.properties 
-- src 
-- pom.xml 

ここに私のポンポンファイルが

<?xml version="1.0"?> 
<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> 
    <groupId>group.id</groupId> 
    <version>1.1.0</version> 

    <artifactId>my-project</artifactId> 

    <build> 
     <plugins> 
      <plugin> 
       <inherited>true</inherited> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.1</version> 

       <configuration> 
        <encoding>UTF-8</encoding> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 

      <plugin> 
       <inherited>true</inherited> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-resources-plugin</artifactId> 
       <version>2.6</version> 

       <configuration> 
        <encoding>UTF-8</encoding> 
       </configuration> 
      </plugin> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-source-plugin</artifactId> 
       <version>2.2.1</version> 

       <configuration> 
        <encoding>UTF-8</encoding> 
       </configuration> 

       <executions> 
        <execution> 
         <id>attach-sources</id> 
         <goals> 
          <goal>jar</goal> 
         </goals> 
        </execution> 
       </executions> 
      </plugin> 

      <plugin> 
       <groupId>org.jvnet.jax-ws-commons</groupId> 
       <artifactId>jaxws-maven-plugin</artifactId> 
       <version>2.3</version> 
       <executions> 
        <execution> 
         <id>cdm</id> 
         <goals> 
          <goal>wsimport</goal> 
         </goals> 
         <phase>${wsimport-phase}</phase> 
         <configuration> 
          <sourceDestDir>src/main/java</sourceDestDir> 
          <verbose>true</verbose> 
          <xnoAddressingDataBinding>true</xnoAddressingDataBinding> 
          <xnocompile>true</xnocompile> 
          <target>2.1</target> 
          <wsdlUrls> 
           <wsdlUrl>${osb.url.prefix}MyService${osb.url.suffix}</wsdlUrl> 
          </wsdlUrls> 
         </configuration> 
        </execution> 
       </executions> 
      </plugin> 
     </plugins> 
    </build> 

    <profiles> 
     <profile> 
      <id>via-osb</id> 
      <properties> 
       <wsimport-phase>generate-sources</wsimport-phase> 
       <skip-clean>false</skip-clean> 
       <osb.protocol>http</osb.protocol> 
       <osb.host>my.host</osb.host> 
       <osb.port>80</osb.port> 
       <osb.url.prefix>${osb.protocol}://${osb.host}:${osb.port}/path/to/osb/</osb.url.prefix> 
       <osb.url.suffix>v102?wsdl</osb.url.suffix> 
      </properties> 
     </profile>   
    </profiles> 

</project> 

だ私は何かが足りないのですか? gradle init --type pomコモンズはエラーなしで終了します...

+0

試し '--info'または' --debug'のGradleのコマンドに追加するのか? – RaGe

+0

@RaGeはどちらも「不明なコマンドラインオプション」を返します。 –

+0

@RaGeええと、GradleのアウトサイトSTSがインストールされました。出力を参照してください... –

答えて

0

STSプラグインでいくつかのdiffやバグがありましたが、私はGradleをインストールしたばかりです。また、Run As > Gradle Buildは、initコマンドの--infoオプションを認識しませんでした。

は、ここでの情報の出力

gradle init --info --type pom 
Starting Build 
Settings evaluated using settings file 'C:\master\settings.gradle'. 
Projects loaded. Root project using build file 'C:\my-project\build.gradle'. 
Included projects: [root project 'my-project'] 
Evaluating root project 'my-project' using build file 'C:\my-project\build.gradle' 
. 
All projects evaluated. 
Selected primary task 'init' from project : 
Tasks to be executed: [task ':wrapper', task ':init'] 
:wrapper (Thread[main,5,main]) started. 
:wrapper 
Executing task ':wrapper' (up-to-date check took 0.168 secs) due to: 
    No history is available. 
:wrapper (Thread[main,5,main]) completed. Took 0.656 secs. 
:init (Thread[main,5,main]) started. 
:init 
Executing task ':init' (up-to-date check took 0.001 secs) due to: 
    Task has not declared any outputs. 
Maven to Gradle conversion is an incubating feature. 
:init (Thread[main,5,main]) completed. Took 1.386 secs. 

BUILD SUCCESSFUL 

そして、STS出力

[sts] ----------------------------------------------------- 
[sts] Starting Gradle build for the following tasks: 
[sts]  init 
[sts]  --info 
[sts]  --type 
[sts]  pom 
[sts] ----------------------------------------------------- 

FAILURE: Build failed with an exception. 

* What went wrong: 
Problem configuring task :init from command line. 
> Unknown command-line option '--info'. 
+1

buildshipに移動することを強くお勧めしますhttp://projects.eclipse.org/projects/tools.buildship – RaGe

+0

@RaGeもう一度おねがいします! –

関連する問題