Author: fbricon
Date: 2012-05-04 07:30:47 -0400 (Fri, 04 May 2012)
New Revision: 40787
Added:
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/MavenSeamConstants.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/main/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/main/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/main/resources/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/main/webapp/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/test/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/test/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/src/test/resources/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/add-seam.pom
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/resources/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/faces-config.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/test/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/test/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/test/resources/
Modified:
trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java
Log:
JBIDE-11570 : different fixes :
- do nothing if seam jar is not resolved
- apply the proper JSF Facet version, as per the Seam Facet version requirements
(currently hardcoded to JSF 1.2)
- catch Constraint violation exceptions and turn them into error markers.
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.properties 2012-05-04 11:26:10
UTC (rev 40786)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.properties 2012-05-04 11:30:47
UTC (rev 40787)
@@ -2,4 +2,5 @@
Bundle-Vendor = JBoss by Red Hat
Bundle-Name = JBoss Maven Seam Configurator
Seam_Project_configurator = Seam
-Fix_classpath = Fixing classpath
\ No newline at end of file
+Fix_classpath = Fixing classpath
+Maven_Configuration_Problems=Maven Configuration Problems
\ No newline at end of file
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.xml 2012-05-04 11:26:10 UTC (rev
40786)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/plugin.xml 2012-05-04 11:30:47 UTC (rev
40787)
@@ -36,6 +36,21 @@
secondaryTo="org.eclipse.m2e.jdt.javaConfigurator"/>
</extension>
+ <extension
+ point="org.eclipse.ui.ide.markerSupport">
+ <markerTypeCategory
+ name="%Maven_Configuration_Problems">
+ <markerTypeReference
+ id="org.jbosstools.maven.configuration.seam">
+ </markerTypeReference>
+ </markerTypeCategory>
+ </extension>
-
+ <extension point="org.eclipse.core.resources.markers"
+ id="org.jbosstools.maven.configuration.seam"
+ name="%Maven_Configuration_Problem">
+ <super type="org.eclipse.m2e.core.maven2Problem.configuration"/>
+ <persistent value="true"/>
+ </extension>
+
</plugin>
Added:
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/MavenSeamConstants.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/MavenSeamConstants.java
(rev 0)
+++
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/MavenSeamConstants.java 2012-05-04
11:30:47 UTC (rev 40787)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.maven.seam.configurators;
+
+public class MavenSeamConstants {
+
+ public static final String SEAM_CONFIGURATION_ERROR_MARKER_ID =
"org.jbosstools.maven.configuration.seam";
+ /**
+ * Private constructor to prevent instanciation.
+ */
+ private MavenSeamConstants() {};
+}
Modified:
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java 2012-05-04
11:26:10 UTC (rev 40786)
+++
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/configurators/SeamProjectConfigurator.java 2012-05-04
11:30:47 UTC (rev 40787)
@@ -19,11 +19,13 @@
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.project.MavenProject;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
@@ -35,7 +37,7 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.preference.IPreferenceStore;
import
org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationOperation;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.jst.j2ee.project.EarUtilities;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import
org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
import org.eclipse.m2e.core.internal.IMavenConstants;
@@ -83,15 +85,10 @@
private static final String JBOSS_SEAM_ARTIFACT_ID = "jboss-seam";
//$NON-NLS-1$
protected static final IProjectFacet dynamicWebFacet;
- protected static final IProjectFacetVersion dynamicWebVersion;
protected static final IProjectFacet javaFacet;
- protected static final IProjectFacetVersion javaVersion;
protected static final IProjectFacet jsfFacet;
- protected static final IProjectFacetVersion jsfVersion;
protected static final IProjectFacet earFacet;
- protected static final IProjectFacetVersion earVersion;
protected static final IProjectFacet ejbFacet;
- protected static final IProjectFacetVersion ejbVersion;
protected static final IProjectFacet m2Facet;
protected static final IProjectFacetVersion m2Version;
private static final IProjectFacet seamFacet;
@@ -103,17 +100,12 @@
static {
seamFacet = ProjectFacetsManager.getProjectFacet("jst.seam"); //$NON-NLS-1$
javaFacet = ProjectFacetsManager.getProjectFacet("jst.java"); //$NON-NLS-1$
- javaVersion = javaFacet.getVersion("5.0"); //$NON-NLS-1$
dynamicWebFacet = ProjectFacetsManager.getProjectFacet("jst.web");
//$NON-NLS-1$
- dynamicWebVersion = dynamicWebFacet.getVersion("2.5"); //$NON-NLS-1$
jsfFacet = ProjectFacetsManager.getProjectFacet("jst.jsf"); //$NON-NLS-1$
- jsfVersion = jsfFacet.getVersion("1.2"); //$NON-NLS-1$
earFacet = ProjectFacetsManager.getProjectFacet("jst.ear"); //$NON-NLS-1$
- earVersion = earFacet.getVersion("5.0"); //$NON-NLS-1$
m2Facet = ProjectFacetsManager.getProjectFacet("jboss.m2"); //$NON-NLS-1$
m2Version = m2Facet.getVersion("1.0"); //$NON-NLS-1$
ejbFacet = ProjectFacetsManager.getProjectFacet("jst.ejb"); //$NON-NLS-1$
- ejbVersion = ejbFacet.getVersion("3.0"); //$NON-NLS-1$
portletFacet = ProjectFacetsManager.getProjectFacet("jboss.portlet");
//$NON-NLS-1$
jsfportletFacet = ProjectFacetsManager.getProjectFacet("jboss.jsfportlet");
//$NON-NLS-1$
seamPortletFacet = ProjectFacetsManager.getProjectFacet("jboss.seamportlet");
//$NON-NLS-1$
@@ -150,10 +142,11 @@
if (rootSeamProject != null && isSeamSettingChangedByUser(rootSeamProject)) {
return;
}
+ clearMarkers(project);
String packaging = mavenProject.getPackaging();
String seamVersion = getSeamVersion(mavenProject);
if (seamVersion != null) {
- IProject[] earProjects = J2EEProjectUtilities.getReferencingEARProjects(project);
+ IProject[] earProjects = EarUtilities.getReferencingEARProjects(project);
String deploying = packaging;
if (earProjects.length > 0) {
deploying = "ear"; //$NON-NLS-1$
@@ -162,6 +155,7 @@
if (fproj == null) {
return;
}
+ IProjectFacetVersion seamFacetVersion = getSeamFacetVersion(seamVersion);
if ("war".equals(packaging)) { //$NON-NLS-1$
IDataModel model = createSeamDataModel(deploying, seamVersion, project);
//JBIDE-10785 : refresh parent to prevent
@@ -170,9 +164,9 @@
MavenUtil.refreshParent(mavenProject);
}
- installWarFacets(fproj, model, seamVersion, monitor);
+ installWarFacets(fproj, model, seamFacetVersion, monitor);
} else if ("ear".equals(packaging)) { //$NON-NLS-1$
- installEarFacets(fproj, monitor);
+ installEarFacets(fproj, seamFacetVersion, monitor);
installM2Facet(fproj, monitor);
IProject webProject = getReferencingSeamWebProject(project);
if (webProject != null) {
@@ -223,7 +217,7 @@
} else if ("ejb".equals(packaging)) { //$NON-NLS-1$
installM2Facet(fproj,monitor);
- installEjbFacets(fproj, monitor);
+ installEjbFacets(fproj, seamFacetVersion, monitor);
addSeamSupport(project, earProjects);
storeSettings(project);
@@ -284,34 +278,52 @@
return facetVersion;
}
- private void installEarFacets(IFacetedProject fproj,IProgressMonitor monitor) throws
CoreException {
+ private void installEarFacets(IFacetedProject fproj, IProjectFacetVersion seamFv,
IProgressMonitor monitor) throws CoreException {
if (!fproj.hasProjectFacet(earFacet)) {
- fproj.installProjectFacet(earVersion, null, monitor);
+ IProjectFacetVersion earVersion = findTargetFacetVersion(seamFv, earFacet);
+ fproj.installProjectFacet(earVersion , null, monitor);
}
}
- private void installEjbFacets(IFacetedProject fproj,IProgressMonitor monitor) throws
CoreException {
+ private void installEjbFacets(IFacetedProject fproj, IProjectFacetVersion seamFv,
IProgressMonitor monitor) throws CoreException {
if (!fproj.hasProjectFacet(javaFacet)) {
- fproj.installProjectFacet(javaVersion, null, monitor);
+ IProjectFacetVersion javaVersion = findTargetFacetVersion(seamFv, javaFacet);
+ fproj.installProjectFacet(javaVersion , null, monitor);
}
if (!fproj.hasProjectFacet(ejbFacet)) {
+ IProjectFacetVersion ejbVersion = findTargetFacetVersion(seamFv, ejbFacet);
fproj.installProjectFacet(ejbVersion, null, monitor);
}
}
- private void installWarFacets(IFacetedProject fproj,IDataModel model, String
seamVersion,IProgressMonitor monitor) throws CoreException {
+ private void installWarFacets(IFacetedProject fproj,IDataModel model,
IProjectFacetVersion seamFacetVersion, IProgressMonitor monitor) throws CoreException {
+ //Seam requires the JSF facet (!!!)
+ boolean hasConflicts = false;
+ for (IProjectFacetVersion fv : fproj.getProjectFacets()) {
+ if (seamFacetVersion.conflictsWith(fv)) {
+ addErrorMarker(fproj.getProject(), seamFacetVersion + " can not be installed as
it conflicts with "+ fv);
+ hasConflicts = true;
+ }
+ }
+
+ if (hasConflicts) {
+ return;
+ }
+
if (!fproj.hasProjectFacet(javaFacet)) {
+ IProjectFacetVersion javaVersion = findTargetFacetVersion(seamFacetVersion,
javaFacet);
fproj.installProjectFacet(javaVersion, null, monitor);
}
if (!fproj.hasProjectFacet(dynamicWebFacet)) {
+ IProjectFacetVersion dynamicWebVersion = findTargetFacetVersion(seamFacetVersion,
dynamicWebFacet);
fproj.installProjectFacet(dynamicWebVersion, null, monitor);
}
- //Seam requires the JSF facet (!!!)
- installJSFFacet(fproj, monitor);
+ IProjectFacetVersion jsfVersion = findTargetFacetVersion(seamFacetVersion, jsfFacet);
+ installJSFFacet(fproj, jsfVersion, monitor);
installM2Facet(fproj, monitor);
+
if (!fproj.hasProjectFacet(seamFacet)) {
- IProjectFacetVersion seamFacetVersion = getSeamFacetVersion(seamVersion);
fproj.installProjectFacet(seamFacetVersion, model, monitor);
} else {
String deploying =
model.getStringProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS);
@@ -341,6 +353,23 @@
}
}
+ private void clearMarkers(IProject project) throws CoreException {
+ markerManager.deleteMarkers(project,
MavenSeamConstants.SEAM_CONFIGURATION_ERROR_MARKER_ID);
+ }
+
+ private IProjectFacetVersion findTargetFacetVersion(IProjectFacetVersion seamFv,
IProjectFacet targetFacet) throws CoreException {
+ // Super simplified way to find the target Facet version :
+ // we take the first one that doesn't conflict with the target Seam Facet Version
+ if (seamFv != null) {
+ for (IProjectFacetVersion jsfFv : targetFacet.getSortedVersions(true)) {
+ if (!seamFv.conflictsWith(jsfFv)) {
+ return jsfFv;
+ }
+ }
+ }
+ return null;
+ }
+
private void setModelProperty(IDataModel model, IEclipsePreferences prefs, String
property) {
String value = model.getStringProperty(property);
if (value != null && value.trim().length() > 0) {
@@ -348,10 +377,10 @@
}
}
- private void installJSFFacet(IFacetedProject fproj, IProgressMonitor monitor)
+ private void installJSFFacet(IFacetedProject fproj, IProjectFacetVersion jsfVersion,
IProgressMonitor monitor)
throws CoreException {
- if (!fproj.hasProjectFacet(jsfFacet)) {
- IDataModel model =
MavenJSFActivator.getDefault().createJSFDataModel(fproj,jsfVersion);
+ if (jsfFacet != null && !fproj.hasProjectFacet(jsfFacet)) {
+ IDataModel model = MavenJSFActivator.getDefault().createJSFDataModel(fproj,jsfVersion
);
//Fix for JBIDE-9454, to prevent complete overwrite of web.xml
model.setBooleanProperty(IJSFFacetInstallDataModelProperties.CONFIGURE_SERVLET,false);
fproj.installProjectFacet(jsfVersion, model, monitor);
@@ -398,7 +427,25 @@
}
- private IProject getReferencingSeamWebProject(IProject earProject)
+ private IProject getReferencingSeamWebProject(IProject earProject) throws CoreException
{
+ Criteria criteria = new Criteria() {
+ public boolean applies(IProject project) {
+ return project != null &&
JavaEEProjectUtilities.isDynamicWebProject(project);
+ }
+ };
+ return getReferencingSeamProject(earProject, criteria);
+ }
+
+ private IProject getReferencingSeamEJBProject(IProject earProject) throws CoreException
{
+ Criteria criteria = new Criteria() {
+ public boolean applies(IProject project) {
+ return project != null && JavaEEProjectUtilities.isEJBProject(project);
+ }
+ };
+ return getReferencingSeamProject(earProject, criteria);
+ }
+
+ private IProject getReferencingSeamProject(IProject earProject, Criteria criteria)
throws CoreException {
IVirtualComponent component = ComponentCore.createComponent(earProject);
if (component != null) {
@@ -406,7 +453,7 @@
for (int i = 0; i < references.length; i++) {
IVirtualComponent refComponent = references[i].getReferencedComponent();
IProject refProject = refComponent.getProject();
- if (JavaEEProjectUtilities.isDynamicWebProject(refProject)) {
+ if (criteria.applies(refProject)) {
if (refProject.hasNature(IMavenConstants.NATURE_ID)) {
IFile pom = refProject.getFile(IMavenConstants.POM_FILE_NAME);
if (pom.exists()) {
@@ -429,48 +476,13 @@
}
return null;
}
-
- private IProject getReferencingSeamEJBProject(IProject earProject)
- throws CoreException {
- IVirtualComponent component = ComponentCore.createComponent(earProject);
- if (component != null) {
- IVirtualReference[] references = component.getReferences();
- for (int i = 0; i < references.length; i++) {
- IVirtualComponent refComponent = references[i].getReferencedComponent();
- IProject refProject = refComponent.getProject();
- if (JavaEEProjectUtilities.isEJBProject(refProject)) {
- if (refProject.hasNature(IMavenConstants.NATURE_ID)) {
- IFile pom = refProject
- .getFile(IMavenConstants.POM_FILE_NAME);
- if (pom.exists()) {
- MavenProjectManager projectManager = MavenPluginActivator
- .getDefault().getMavenProjectManager();
- IMavenProjectFacade facade = projectManager.create(
- pom, true, null);
- if (facade != null) {
- MavenProject mavenProject = facade
- .getMavenProject(null);
- if (mavenProject != null) {
- String version = getSeamVersion(mavenProject);
- if (version != null) {
- return refProject;
- }
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
private String getSeamVersion(MavenProject mavenProject) {
List<Artifact> artifacts = new ArrayList<Artifact>();
ArtifactFilter filter = new ScopeArtifactFilter(Artifact.SCOPE_TEST);
for (Artifact artifact : mavenProject.getArtifacts()) {
- if (filter.include(artifact)) {
+ if (filter.include(artifact) && artifact.isResolved()) {
artifacts.add(artifact);
}
}
@@ -633,7 +645,18 @@
protected void updateEARDD(IProgressMonitor monitor) {
//super.updateEARDD(monitor);
}
+ }
+
+ private static interface Criteria {
+ boolean applies(IProject project);
+ }
+ @SuppressWarnings("restriction")
+ private void addErrorMarker(IProject project, String message) {
+ markerManager.addMarker(project,
+ MavenSeamConstants.SEAM_CONFIGURATION_ERROR_MARKER_ID,
+ message
+ ,-1, IMarker.SEVERITY_ERROR);
}
}
Added:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/pom.xml
===================================================================
---
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/pom.xml
(rev 0)
+++
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/missing-seam/pom.xml 2012-05-04
11:30:47 UTC (rev 40787)
@@ -0,0 +1,15 @@
+<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>foo.bar</groupId>
+ <artifactId>missing-seam</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>missing</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/add-seam.pom
===================================================================
---
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/add-seam.pom
(rev 0)
+++
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/add-seam.pom 2012-05-04
11:30:47 UTC (rev 40787)
@@ -0,0 +1,38 @@
+<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>foo.bar</groupId>
+ <artifactId>violation</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_15</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>2.3.0.Beta1</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <!-- You should seriously consider using a repository manager or declare
repositories in your settings.xml.
+ See
http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-p...
-->
+ <repository>
+ <!-- The JBoss Public repository is a composite repository of several major
repositories.
+ See
http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <id>jboss-public-repository</id>
+ <
url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <!-- You can disable snapshot resolution to speed up your builds -->
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
+</project>
\ No newline at end of file
Added:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/pom.xml
===================================================================
---
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/pom.xml
(rev 0)
+++
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/pom.xml 2012-05-04
11:30:47 UTC (rev 40787)
@@ -0,0 +1,32 @@
+<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>foo.bar</groupId>
+ <artifactId>violation</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_15</version>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <!-- You should seriously consider using a repository manager or declare
repositories in your settings.xml.
+ See
http://www.sonatype.com/people/2009/02/why-putting-repositories-in-your-p...
-->
+ <repository>
+ <!-- The JBoss Public repository is a composite repository of several major
repositories.
+ See
http://community.jboss.org/wiki/MavenGettingStarted-Users -->
+ <id>jboss-public-repository</id>
+ <
url>http://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <!-- You can disable snapshot resolution to speed up your builds -->
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
+</project>
\ No newline at end of file
Added:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/seam/violation/src/main/webapp/WEB-INF/faces-config.xml 2012-05-04
11:30:47 UTC (rev 40787)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
+ version="1.2">
+
+</faces-config>
Modified:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java
===================================================================
---
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java 2012-05-04
11:26:10 UTC (rev 40786)
+++
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/AbstractMavenConfiguratorTest.java 2012-05-04
11:30:47 UTC (rev 40787)
@@ -13,8 +13,10 @@
import java.io.File;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jst.common.project.facet.core.JavaFacet;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.project.IProjectConfigurationManager;
@@ -88,4 +90,18 @@
protected void updateProject(IProject project) throws Exception {
updateProject(project, null, -1);
}
+
+ protected void assertHasError(IProject project, String errorMessage) {
+ try {
+ for (IMarker m : findErrorMarkers(project)) {
+ String message = (String)m.getAttribute(IMarker.MESSAGE);
+ if (errorMessage.equals(message)){
+ return;
+ }
+ }
+ } catch (CoreException e) {
+ fail(e.getMessage());
+ }
+ fail("Error Message '"+ errorMessage +"' was not found on
"+project.getName());
+ }
}