Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eclipse update of maven project fails for sonar-cxx-plugin #851

Closed
Bertk opened this issue May 1, 2016 · 10 comments
Closed

eclipse update of maven project fails for sonar-cxx-plugin #851

Bertk opened this issue May 1, 2016 · 10 comments
Assignees
Labels
Milestone

Comments

@Bertk
Copy link
Contributor

Bertk commented May 1, 2016

Eclipse fails to update the project definition from pom.xml

!ENTRY org.eclipse.m2e.core 4 0 2016-05-01 16:52:54.074
!MESSAGE Could not update project sonar-cxx-plugin configuration
!STACK 0
java.lang.NullPointerException
        at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.isContained(AbstractJavaProjectConfigurator.java:470)
        at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.isNonOverlappingResourceDescriptor(AbstractJavaProjectConfigurator.java:461)
        at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.addResourceDirs(AbstractJavaProjectConfigurator.java:422)
        at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.addProjectSourceFolders(AbstractJavaProjectConfigurator.java:299)
        at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.configure(AbstractJavaProjectConfigurator.java:122)
        at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:120)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$3.call(ProjectConfigurationManager.java:501)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$3.call(ProjectConfigurationManager.java:1)
        at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
        at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:494)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProjects(ProjectConfigurationManager.java:281)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:168)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:1)
        at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
        at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
        at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
        at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1355)
        at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:136)
        at org.eclipse.m2e.core.ui.internal.wizards.ImportMavenProjectsJob$1.doCreateMavenProjects(ImportMavenProjectsJob.java:68)
        at org.eclipse.m2e.core.ui.internal.wizards.AbstractCreateMavenProjectsOperation.run(AbstractCreateMavenProjectsOperation.java:62)
        at org.eclipse.m2e.core.ui.internal.wizards.ImportMavenProjectsJob.runInWorkspace(ImportMavenProjectsJob.java:77)
        at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

The pom.xml shows a resource using a location outside of the project folder which causes the issue. After removing the resource from the pom.xml the update works again.

      <resource>
        <targetPath>static</targetPath>
        <directory>../cxx-lint/target</directory>
        <includes>
          <include>cxx-lint-${project.version}.jar</include>
        </includes>
      </resource>
@guwirth guwirth added the bug label May 1, 2016
@guwirth guwirth added this to the 0.9.6 milestone May 1, 2016
@guwirth
Copy link
Collaborator

guwirth commented May 1, 2016

@jmecosta maybe you can fix it?

@jmecosta
Copy link
Member

jmecosta commented May 1, 2016

i dont know, but seems to work with netbeans and maven command line. perhaps some eclipse bug? seems a standard maven feature and we dont have issues with it. is there more people having same issue with other ides?

@guwirth
Copy link
Collaborator

guwirth commented May 1, 2016

I'm using NetBeans and Maven: it's working with both.

@Bertk
Copy link
Contributor Author

Bertk commented May 8, 2016

I modified the pom.xml and this version works fine. Please check.
I did not remove the SQ version for the sonar-plugin-api or sonar-check-api but this should be defined in the parent pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.codehaus.sonar-plugins.cxx</groupId>
    <artifactId>cxx</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>

  <artifactId>sonar-cxx-plugin</artifactId>
  <packaging>sonar-plugin</packaging>

  <name>Cxx :: Sonar Plugin</name>
  <inceptionYear>2010</inceptionYear>
  <description>Enable analysis and reporting on c++ projects.</description>
  <url>https://github.com/SonarOpenCommunity/sonar-cxx/wiki</url>

  <properties>
    <sonar.artifact.path>target/${project.artifactId}-${project.version}.jar</sonar.artifact.path>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-plugin-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-deprecated</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.sonar.dotnet.tests</groupId>
      <artifactId>sonar-dotnet-tests-library</artifactId>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>cxx-squid</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>cxx-checks</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.sonarsource.sslr</groupId>
      <artifactId>sslr-testing-harness</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.0.9</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.sonar</groupId>
      <artifactId>sonar-testing-harness</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
    </dependency>
    <dependency>
      <groupId>jdom</groupId>
      <artifactId>jdom</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.sonar.common-rules</groupId>
      <artifactId>sonar-common-rules</artifactId>
      </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>cxx-lint</artifactId>
        <version>${project.version}</version>
    </dependency>
  </dependencies>

 <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>com/sonar/sqale/cxx-model-project*</exclude>
          <exclude>external/*</exclude>
        </excludes>
      </resource>
<!-- 
      <resource>
        <targetPath>static</targetPath>
        <directory>../cxx-lint/target</directory>
        <includes>
          <include>cxx-lint-${project.version}.jar</include>
        </includes>
      </resource>
 -->    
    </resources>
  </build>
</project>

@jmecosta
Copy link
Member

jmecosta commented May 8, 2016

@Bertk i will create a pr to and test in netbeans, dont see any reason not to merge this change

@jmecosta
Copy link
Member

jmecosta commented May 8, 2016

@Bertk are you sure the pom you posted is correct? as far as i see there are no differences to current master.

image

@Bertk
Copy link
Contributor Author

Bertk commented May 8, 2016

@jmecosta : OK let us close this issue. I cannot find the strange path in the pom.xml.

      <resource>
        <targetPath>static</targetPath>
        <directory>../cxx-lint/target</directory>
        <includes>
          <include>cxx-lint-${project.version}.jar</include>
        </includes>
      </resource>

@Bertk Bertk closed this as completed May 8, 2016
@jmecosta
Copy link
Member

jmecosta commented May 8, 2016

But that's the pom for the cxx-plugin perhaps you need to share that one

@Bertk
Copy link
Contributor Author

Bertk commented May 9, 2016

@jmecosta Thanks for the hint. I updated the comment with the pom.xml details and now it should be clear 😎

@jmecosta jmecosta self-assigned this May 10, 2016
@jmecosta
Copy link
Member

fixed by #863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants