Gradle create pom failed












1














I wanted to create a pom.xml with Gradle.
But it failed.



Here my build.gradle (project)



   // Top-level build file where you can add configuration options common      to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

task writeNewPom {
doLast {
pom {
project {
inceptionYear '2008'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}.writeTo("$buildDir/pom.xml")
}
}


and my build.gradle (module)



apply plugin: 'com.android.application'

apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.ludev-studio'

apply plugin: 'maven'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.ludevstudio.colorpicker"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard- android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '28.0.3'
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
implementation project(':colorpicker')
}


this is the output, then I executet the writeNewPom Task with the gradlew.bat:



FAILURE: Build failed with an exception.

* Where:
Build file 'C:UserslucadDocumentsprogrammierungProjekteJavaAndroidlibrariesColo rpickerbuild.gradle' line: 32

* What went wrong:
Execution failed for task ':writeNewPom'.
> Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65 $_run_closure3$_closure5 $_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':writeNewPom'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:103)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute (ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execu te(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.exe cute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute (ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute (SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute (CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at o rg.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run (ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.
atorg.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:179)
at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:164)
at org.gradle.api.DefaultTask_Decorated.invokeMethod(Unknown Source)
at build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5.doCall(C:UserslucadDocumentsprogrammierungProjekteJavaAndroidlibrariesColorpickerbuild.gradle:32)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:726)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:699)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run (ExecuteActionsTaskExecuter.java:124) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperation Worker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperation Worker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute (DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction (ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:95)
... 30 more


* Get more help at https://help.gradle.org

BUILD FAILED in 8s
1 actionable task: 1 executed


I red something about missing maven plugin, but like you can see in my gradle.build, I added the plugin.
So, what to do?










share|improve this question



























    1














    I wanted to create a pom.xml with Gradle.
    But it failed.



    Here my build.gradle (project)



       // Top-level build file where you can add configuration options common      to all sub-projects/modules.
    buildscript {
    repositories {
    google()
    jcenter()
    }
    dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    }
    }

    allprojects {
    repositories {
    google()
    jcenter()
    }
    }

    task clean(type: Delete) {
    delete rootProject.buildDir
    }

    task writeNewPom {
    doLast {
    pom {
    project {
    inceptionYear '2008'
    licenses {
    license {
    name 'The Apache Software License, Version 2.0'
    url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    distribution 'repo'
    }
    }
    }
    }.writeTo("$buildDir/pom.xml")
    }
    }


    and my build.gradle (module)



    apply plugin: 'com.android.application'

    apply plugin: 'com.github.dcendents.android-maven'
    group = 'com.github.ludev-studio'

    apply plugin: 'maven'

    android {
    compileSdkVersion 28
    defaultConfig {
    applicationId "com.ludevstudio.colorpicker"
    minSdkVersion 15
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    }
    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard- android.txt'), 'proguard-rules.pro'
    }
    }
    buildToolsVersion '28.0.3'
    }

    dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    testImplementation 'junit:junit:4.12'
    implementation project(':colorpicker')
    }


    this is the output, then I executet the writeNewPom Task with the gradlew.bat:



    FAILURE: Build failed with an exception.

    * Where:
    Build file 'C:UserslucadDocumentsprogrammierungProjekteJavaAndroidlibrariesColo rpickerbuild.gradle' line: 32

    * What went wrong:
    Execution failed for task ':writeNewPom'.
    > Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65 $_run_closure3$_closure5 $_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.

    * Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':writeNewPom'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:103)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute (ExecuteActionsTaskExecuter.java:73)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execu te(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.exe cute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute (ValidatingTaskExecuter.java:59)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute (SkipEmptySourceFilesTaskExecuter.java:101)
    at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute (CleanupStaleOutputsExecuter.java:91)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
    at o rg.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run (ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.
    atorg.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:179)
    at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:164)
    at org.gradle.api.DefaultTask_Decorated.invokeMethod(Unknown Source)
    at build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5.doCall(C:UserslucadDocumentsprogrammierungProjekteJavaAndroidlibrariesColorpickerbuild.gradle:32)
    at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:726)
    at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:699)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run (ExecuteActionsTaskExecuter.java:124) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperation Worker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperation Worker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute (DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction (ExecuteActionsTaskExecuter.java:113)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:95)
    ... 30 more


    * Get more help at https://help.gradle.org

    BUILD FAILED in 8s
    1 actionable task: 1 executed


    I red something about missing maven plugin, but like you can see in my gradle.build, I added the plugin.
    So, what to do?










    share|improve this question

























      1












      1








      1







      I wanted to create a pom.xml with Gradle.
      But it failed.



      Here my build.gradle (project)



         // Top-level build file where you can add configuration options common      to all sub-projects/modules.
      buildscript {
      repositories {
      google()
      jcenter()
      }
      dependencies {
      classpath 'com.android.tools.build:gradle:3.2.1'
      classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
      }
      }

      allprojects {
      repositories {
      google()
      jcenter()
      }
      }

      task clean(type: Delete) {
      delete rootProject.buildDir
      }

      task writeNewPom {
      doLast {
      pom {
      project {
      inceptionYear '2008'
      licenses {
      license {
      name 'The Apache Software License, Version 2.0'
      url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
      distribution 'repo'
      }
      }
      }
      }.writeTo("$buildDir/pom.xml")
      }
      }


      and my build.gradle (module)



      apply plugin: 'com.android.application'

      apply plugin: 'com.github.dcendents.android-maven'
      group = 'com.github.ludev-studio'

      apply plugin: 'maven'

      android {
      compileSdkVersion 28
      defaultConfig {
      applicationId "com.ludevstudio.colorpicker"
      minSdkVersion 15
      targetSdkVersion 28
      versionCode 1
      versionName "1.0"
      }
      buildTypes {
      release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard- android.txt'), 'proguard-rules.pro'
      }
      }
      buildToolsVersion '28.0.3'
      }

      dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.support:appcompat-v7:28.0.0'
      testImplementation 'junit:junit:4.12'
      implementation project(':colorpicker')
      }


      this is the output, then I executet the writeNewPom Task with the gradlew.bat:



      FAILURE: Build failed with an exception.

      * Where:
      Build file 'C:UserslucadDocumentsprogrammierungProjekteJavaAndroidlibrariesColo rpickerbuild.gradle' line: 32

      * What went wrong:
      Execution failed for task ':writeNewPom'.
      > Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65 $_run_closure3$_closure5 $_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.

      * Try:
      Run with --info or --debug option to get more log output. Run with --scan to get full insights.

      * Exception is:
      org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':writeNewPom'.
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:103)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute (ExecuteActionsTaskExecuter.java:73)
      at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execu te(OutputDirectoryCreatingTaskExecuter.java:51)
      at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
      at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.exe cute(ResolveTaskOutputCachingStateExecuter.java:54)
      at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute (ValidatingTaskExecuter.java:59)
      at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute (SkipEmptySourceFilesTaskExecuter.java:101)
      at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute (CleanupStaleOutputsExecuter.java:91)
      at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
      at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:110)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
      at o rg.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run (ManagedExecutorImpl.java:46)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
      Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.
      atorg.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:179)
      at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:164)
      at org.gradle.api.DefaultTask_Decorated.invokeMethod(Unknown Source)
      at build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5.doCall(C:UserslucadDocumentsprogrammierungProjekteJavaAndroidlibrariesColorpickerbuild.gradle:32)
      at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:726)
      at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:699)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run (ExecuteActionsTaskExecuter.java:124) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperation Worker.execute(DefaultBuildOperationExecutor.java:336)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperation Worker.execute(DefaultBuildOperationExecutor.java:328)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute (DefaultBuildOperationExecutor.java:199)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:110)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction (ExecuteActionsTaskExecuter.java:113)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:95)
      ... 30 more


      * Get more help at https://help.gradle.org

      BUILD FAILED in 8s
      1 actionable task: 1 executed


      I red something about missing maven plugin, but like you can see in my gradle.build, I added the plugin.
      So, what to do?










      share|improve this question













      I wanted to create a pom.xml with Gradle.
      But it failed.



      Here my build.gradle (project)



         // Top-level build file where you can add configuration options common      to all sub-projects/modules.
      buildscript {
      repositories {
      google()
      jcenter()
      }
      dependencies {
      classpath 'com.android.tools.build:gradle:3.2.1'
      classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
      }
      }

      allprojects {
      repositories {
      google()
      jcenter()
      }
      }

      task clean(type: Delete) {
      delete rootProject.buildDir
      }

      task writeNewPom {
      doLast {
      pom {
      project {
      inceptionYear '2008'
      licenses {
      license {
      name 'The Apache Software License, Version 2.0'
      url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
      distribution 'repo'
      }
      }
      }
      }.writeTo("$buildDir/pom.xml")
      }
      }


      and my build.gradle (module)



      apply plugin: 'com.android.application'

      apply plugin: 'com.github.dcendents.android-maven'
      group = 'com.github.ludev-studio'

      apply plugin: 'maven'

      android {
      compileSdkVersion 28
      defaultConfig {
      applicationId "com.ludevstudio.colorpicker"
      minSdkVersion 15
      targetSdkVersion 28
      versionCode 1
      versionName "1.0"
      }
      buildTypes {
      release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard- android.txt'), 'proguard-rules.pro'
      }
      }
      buildToolsVersion '28.0.3'
      }

      dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.support:appcompat-v7:28.0.0'
      testImplementation 'junit:junit:4.12'
      implementation project(':colorpicker')
      }


      this is the output, then I executet the writeNewPom Task with the gradlew.bat:



      FAILURE: Build failed with an exception.

      * Where:
      Build file 'C:UserslucadDocumentsprogrammierungProjekteJavaAndroidlibrariesColo rpickerbuild.gradle' line: 32

      * What went wrong:
      Execution failed for task ':writeNewPom'.
      > Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65 $_run_closure3$_closure5 $_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.

      * Try:
      Run with --info or --debug option to get more log output. Run with --scan to get full insights.

      * Exception is:
      org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':writeNewPom'.
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:103)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute (ExecuteActionsTaskExecuter.java:73)
      at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execu te(OutputDirectoryCreatingTaskExecuter.java:51)
      at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
      at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.exe cute(ResolveTaskOutputCachingStateExecuter.java:54)
      at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute (ValidatingTaskExecuter.java:59)
      at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute (SkipEmptySourceFilesTaskExecuter.java:101)
      at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute (CleanupStaleOutputsExecuter.java:91)
      at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
      at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:110)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
      at o rg.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run (ManagedExecutorImpl.java:46)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
      Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.
      atorg.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:179)
      at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:164)
      at org.gradle.api.DefaultTask_Decorated.invokeMethod(Unknown Source)
      at build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5.doCall(C:UserslucadDocumentsprogrammierungProjekteJavaAndroidlibrariesColorpickerbuild.gradle:32)
      at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:726)
      at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:699)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run (ExecuteActionsTaskExecuter.java:124) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperation Worker.execute(DefaultBuildOperationExecutor.java:336)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperation Worker.execute(DefaultBuildOperationExecutor.java:328)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute (DefaultBuildOperationExecutor.java:199)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:110)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction (ExecuteActionsTaskExecuter.java:113)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:95)
      ... 30 more


      * Get more help at https://help.gradle.org

      BUILD FAILED in 8s
      1 actionable task: 1 executed


      I red something about missing maven plugin, but like you can see in my gradle.build, I added the plugin.
      So, what to do?







      maven android-studio gradle






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 at 18:34









      Luxaaa

      93




      93
























          1 Answer
          1






          active

          oldest

          votes


















          0














          From your trace



          Caused by:     org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.


          Gradle couldn't find any suitable type to delegate the pom() method to, thats because you forgot



          apply plugin: 'maven'



          in your projectbuild.gradle. Just put the above line in your project build.gradle and it'll all be good.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53436539%2fgradle-create-pom-failed%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            From your trace



            Caused by:     org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.


            Gradle couldn't find any suitable type to delegate the pom() method to, thats because you forgot



            apply plugin: 'maven'



            in your projectbuild.gradle. Just put the above line in your project build.gradle and it'll all be good.






            share|improve this answer




























              0














              From your trace



              Caused by:     org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.


              Gradle couldn't find any suitable type to delegate the pom() method to, thats because you forgot



              apply plugin: 'maven'



              in your projectbuild.gradle. Just put the above line in your project build.gradle and it'll all be good.






              share|improve this answer


























                0












                0








                0






                From your trace



                Caused by:     org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.


                Gradle couldn't find any suitable type to delegate the pom() method to, thats because you forgot



                apply plugin: 'maven'



                in your projectbuild.gradle. Just put the above line in your project build.gradle and it'll all be good.






                share|improve this answer














                From your trace



                Caused by:     org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method pom() for arguments [build_1nb7g16o7col6erw9g4aech65$_run_closure3$_closure5$_closure6@30d7b2ef] on task ':writeNewPom' of type org.gradle.api.DefaultTask.


                Gradle couldn't find any suitable type to delegate the pom() method to, thats because you forgot



                apply plugin: 'maven'



                in your projectbuild.gradle. Just put the above line in your project build.gradle and it'll all be good.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 24 at 15:45

























                answered Nov 24 at 13:03









                Ryotsu

                550312




                550312






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53436539%2fgradle-create-pom-failed%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Berounka

                    Sphinx de Gizeh

                    Different font size/position of beamer's navigation symbols template's content depending on regular/plain...