You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Gabriel Forro (JIRA)" <ji...@codehaus.org> on 2011/12/08 12:18:39 UTC
[jira] Commented: (MECLIPSE-701) NPE
org.maven.ide.eclipse.wtp.WTPProjectsUtil.isQualifiedAsWebFragment(WTPProjectsUtil.java:462)
[ https://jira.codehaus.org/browse/MECLIPSE-701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=285213#comment-285213 ]
Gabriel Forro commented on MECLIPSE-701:
----------------------------------------
The problem is caused by the:
{code:xml}
<resource>
<directory>../../build/properties</directory>
</resource>
{code}
Probably the '../..' expression is evaluated to a {{null}} value (see line 462 in [WTPProjectsUtil.java|https://github.com/sonatype/m2eclipse-wtp/blob/master/org.maven.ide.eclipse.wtp/src/org/maven/ide/eclipse/wtp/WTPProjectsUtil.java], where {{resourceFolderPath}} has a {{null}} value)
Fortunately there is a workaround:
Replace the mentioned resource definition by the following one in your {{pom.xml}}:
{code:xml}
<resource>
<direcotory>${project.build.directory}/../../../build/properties</directory>
<resource>
{code}
This fixed the problem for me. Unfortunately You can not use the {{$\{basedir\}}} maven property as its usage results to the same NPE. I do not know the reason. :(
> NPE org.maven.ide.eclipse.wtp.WTPProjectsUtil.isQualifiedAsWebFragment(WTPProjectsUtil.java:462)
> ------------------------------------------------------------------------------------------------
>
> Key: MECLIPSE-701
> URL: https://jira.codehaus.org/browse/MECLIPSE-701
> Project: Maven 2.x Eclipse Plugin
> Issue Type: Bug
> Components: M2Eclipse support
> Affects Versions: 2.8
> Reporter: Sebastien Tardif
> Attachments: EclipseIntegration.png, More installation info.png
>
>
> Systematically get NPE when importing simple Maven project to Eclipse SpringSource Tool Suite 2.8.0 release
> Which use m2e 1.0.100.20110804-1717
> Same similar NPE with previous version of Maven integration. I do wonder for the last 6 months if I'm the only one using Maven integration with Eclipse, no kidding.
> !ENTRY org.eclipse.core.jobs 4 2 2011-10-27 10:32:04.383
> !MESSAGE An internal error occurred during: "Importing Maven projects".
> !STACK 0
> java.lang.NullPointerException
> at org.maven.ide.eclipse.wtp.WTPProjectsUtil.isQualifiedAsWebFragment(WTPProjectsUtil.java:462)
> at org.maven.ide.eclipse.wtp.WebFragmentProjectConfigurator.configure(WebFragmentProjectConfigurator.java:59)
> at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:72)
> at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:302)
> at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProject(ProjectConfigurationManager.java:234)
> at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:150)
> at org.eclipse.m2e.core.ui.internal.wizards.MavenImportWizard$1.doCreateMavenProjects(MavenImportWizard.java:164)
> at org.eclipse.m2e.core.ui.internal.wizards.AbstractCreateMavenProjectsOperation.run(AbstractCreateMavenProjectsOperation.java:73)
> at org.eclipse.m2e.core.ui.internal.wizards.MavenImportWizard$3.runInWorkspace(MavenImportWizard.java:249)
> at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
> !ENTRY org.eclipse.core.jobs 4 2 2011-10-27 10:32:15.816
> !MESSAGE An internal error occurred during: "Updating Maven Configuration".
> !STACK 0
> java.lang.NullPointerException
> at org.maven.ide.eclipse.wtp.WTPProjectsUtil.isQualifiedAsWebFragment(WTPProjectsUtil.java:462)
> at org.maven.ide.eclipse.wtp.WebFragmentProjectConfigurator.configure(WebFragmentProjectConfigurator.java:59)
> at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:72)
> at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:302)
> at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:277)
> at org.eclipse.m2e.core.ui.internal.UpdateConfigurationJob.runInWorkspace(UpdateConfigurationJob.java:87)
> at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
> pom.xml
> <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/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.onassignment.ops</groupId>
> <artifactId>functional.tests</artifactId>
> <packaging>jar</packaging>
> <version>0.0.1-SNAPSHOT</version>
> <name>OPS Functional Tests</name>
> <properties>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> </properties>
> <dependencies>
> <dependency>
> <groupId>org.seleniumhq.selenium</groupId>
> <artifactId>selenium-java</artifactId>
> <version>2.9.0</version>
> </dependency>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.8.2</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>cpsuite</groupId>
> <artifactId>cpsuite</artifactId>
> <version>1.2.5</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> <repositories>
> <repository>
> <id>http://maven.xwiki.org</id>
> <url>http://maven.xwiki.org/externals</url>
> </repository>
> </repositories>
> <pluginRepositories>
> <pluginRepository>
> <id>selenium</id>
> <url>http://repo1.maven.org/maven2/org/seleniumhq/selenium/</url>
> </pluginRepository>
> </pluginRepositories>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <version>2.10</version>
> <configuration>
> <includes>
> <include>**/AllTestsSuite*.java</include>
> </includes>
> </configuration>
> </plugin>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-compiler-plugin</artifactId>
> <version>2.3.2</version>
> <configuration>
> <source>1.6</source>
> <target>1.6</target>
> </configuration>
> </plugin>
> </plugins>
> <resources>
> <resource>
> <directory>src/main/resources</directory>
> </resource>
> <resource>
> <directory>../../build/properties</directory>
> </resource>
> </resources>
> </build>
> </project>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira