0

Upon adding this

  <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
              <archive>
                <manifest>
                  <mainClass>com.mimos.java.jira.rest.JavaJiraFrame</mainClass>
                </manifest>
              </archive>                  
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>

to maven, I'm unable to compile my code. Error thrown as below

Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project java-jira-rest: Failed to clean project: Failed to delete 
C:\Users\puven.selladura\Documents\NetBeansProjects\java-jira-rest\target -> [Help 1]
Abdelhak
  • 8,299
  • 4
  • 22
  • 36
Puven Mannen
  • 3
  • 1
  • 5
  • check a shell open on the target folder, which makes the clean phase fail. Moreover, not sure the configuration you applied is valid for the Maven Compiler Plugin, looks more something for the Jar Plugin – A_Di-Matteo Dec 09 '15 at 08:12
  • It is suppose to create an executable jar file with maven – Puven Mannen Dec 09 '15 at 08:26
  • That would not work. Check this question/answer http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven?lq=1 – A_Di-Matteo Dec 09 '15 at 08:39
  • Remove the `archive` configuration from maven-compiler-plugin cause it does not have such configuration. Furthermore why are you using such old versions of [`maven-clean-plugin` ](http://maven.apache.org/plugins/maven-clean-plugin/). The list of up-to-date plugins can be found here: http://maven.apache.org/plugins/ – khmarbaise Dec 09 '15 at 09:00
  • got the answer from [here](http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) – Puven Mannen Dec 09 '15 at 09:21

1 Answers1

3

This error happens when you have one of the files in target locked and the target/ directory could not be deleted.

For me it's mostly having an editor open on one of the failed tests or having a cmd / shell opened in a directory below target/

Jan
  • 13,738
  • 3
  • 30
  • 55