0
votes

I am trying to build an opensource project using gradle, but when I run the "gradle clean" command within my local repository directory the following error message appears.

FAILURE: Build failed with an exception.
  • Where:

    Build file '/home/muhammad/OpenSource/iotsys/iotsys/build.gradle' line: 3

  • What went wrong:

    A problem occurred evaluating root project 'iotsys'.
    Plugin with id 'maven-publish' not found.

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

my "build.gradle" file look like this

allprojects {
    apply plugin: 'java'
    apply plugin: 'maven-publish'
apply plugin: 'maven'

group = 'at.ac.tuwien.auto.iotsys'
version = '0.1'
sourceCompatibility = 1.6

repositories(){
    mavenCentral()
    mavenRepo url: 'https://repository.jboss.org/nexus/content/repositories/releases/', name: 'JBoss Releases'
    mavenRepo url: 'https://repository.jboss.org/nexus/content/groups/public/', name: 'JBoss Public' }}

I am new to gradle and maven. Can any one please help me to solve this issue?

1
Which version of Gradle do you use?senyor
I agree either wrong version of gradle or weird char that doesn't show up in the file. The message is saying it is failing at line 3, I added the same thing to my build.gradle and ran the clean target and got a success.Jackie
Oh also aren't you missing a } for your all projects?Jackie
sorry for delayed response, i am using gradle 1.1 which is suggested by the project organization and i also pastd only the part of the file here due to problem with posting whole fileMuhammad Ramshad
The maven-publish plugin was only introduced in Gradle 1.4. TU Wien shouldn't be using 1.1 (or even 1.4) in 2014. :-)Peter Niederwieser

1 Answers

-1
votes

The solution is very very simple you just have to run the studio with administrator privileges..

STEPS : -

  1. Right click on the studio icon.
  2. Run as Administrator.

That's it Enjoy..!