0

在我的虚拟机上尝试mvn -e clean install -Dmaven.test.skip=true -Denv=$ENVIRONMENT 为 webapp 项目做时,我收到错误:

Maven version: 2.0.5
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: unknown:web

Reason: Failed to activate local (project-level) build profiles: Cannot parse profiles.xml resource from directory: /extra/co/workspace/vm-devqa01-g/web


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Failed to activate local (project-level) build profiles: Cannot parse profiles.xml resource from directory: /extra/co/workspace/vm-devqa01-g/web
    at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:373)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:286)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Failed to activate local (project-level) build profiles: Cannot parse profiles.xml resource from directory: /extra/co/workspace/vm-devqa01-g/web
    at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1025)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:697)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:431)
    at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:195)
    at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:523)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:455)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:499)
    at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:359)
    ... 11 more
Caused by: org.apache.maven.profiles.activation.ProfileActivationException: Cannot parse profiles.xml resource from directory: /extra/co/workspace/vm-devqa01-g/web
    at org.apache.maven.project.DefaultMavenProjectBuilder.loadProjectExternalProfiles(DefaultMavenProjectBuilder.java:1296)
    at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1017)
    ... 18 more
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: expected = after attribute name (position: START_DOCUMENT seen ...         http://maven.apache.org/xsd/maven-4.0.0.xsd" profilesXml>... @5:80) 
    at org.codehaus.plexus.util.xml.pull.MXParser.parseAttribute(MXParser.java:2001)
    at org.codehaus.plexus.util.xml.pull.MXParser.parseStartTag(MXParser.java:1796)
    at org.codehaus.plexus.util.xml.pull.MXParser.parseProlog(MXParser.java:1476)
    at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl(MXParser.java:1392)
    at org.codehaus.plexus.util.xml.pull.MXParser.next(MXParser.java:1090)
    at org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader.read(ProfilesXpp3Reader.java:1187)
    at org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader.read(ProfilesXpp3Reader.java:1201)
    at org.apache.maven.profiles.DefaultMavenProfilesBuilder.buildProfiles(DefaultMavenProfilesBuilder.java:77)
    at org.apache.maven.project.DefaultMavenProjectBuilder.loadProjectExternalProfiles(DefaultMavenProjectBuilder.java:1268)
    ... 19 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Mon May 06 18:57:37 EDT 2013
[INFO] Final Memory: 2M/57M
[INFO] ------------------------------------------------------------------------
Building Gryphon...
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: unknown:web

Reason: Failed to activate local (project-level) build profiles: Cannot parse profiles.xml resource from directory: /extra/co/workspace/vm-devqa01-g/web


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Failed to activate local (project-level) build profiles: Cannot parse profiles.xml resource from directory: /extra/co/workspace/vm-devqa01-g/web
    at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:373)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:286)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Failed to activate local (project-level) build profiles: Cannot parse profiles.xml resource from directory: /extra/co/workspace/vm-devqa01-g/web
    at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1025)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:697)
    at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:431)
    at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:195)
    at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:523)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:455)
    at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:499)
    at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:359)
    ... 11 more
Caused by: org.apache.maven.profiles.activation.ProfileActivationException: Cannot parse profiles.xml resource from directory: /extra/co/workspace/vm-devqa01-g/web
    at org.apache.maven.project.DefaultMavenProjectBuilder.loadProjectExternalProfiles(DefaultMavenProjectBuilder.java:1296)
    at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1017)
    ... 18 more
Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: expected = after attribute name (position: START_DOCUMENT seen ...         http://maven.apache.org/xsd/maven-4.0.0.xsd" profilesXml>... @5:80) 
    at org.codehaus.plexus.util.xml.pull.MXParser.parseAttribute(MXParser.java:2001)
    at org.codehaus.plexus.util.xml.pull.MXParser.parseStartTag(MXParser.java:1796)
    at org.codehaus.plexus.util.xml.pull.MXParser.parseProlog(MXParser.java:1476)
    at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl(MXParser.java:1392)
    at org.codehaus.plexus.util.xml.pull.MXParser.next(MXParser.java:1090)
    at org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader.read(ProfilesXpp3Reader.java:1187)
    at org.apache.maven.profiles.io.xpp3.ProfilesXpp3Reader.read(ProfilesXpp3Reader.java:1201)
    at org.apache.maven.profiles.DefaultMavenProfilesBuilder.buildProfiles(DefaultMavenProfilesBuilder.java:77)
    at org.apache.maven.project.DefaultMavenProjectBuilder.loadProjectExternalProfiles(DefaultMavenProjectBuilder.java:1268)
    ... 19 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Mon May 06 18:57:38 EDT 2013
[INFO] Final Memory: 2M/57M
[INFO] ------------------------------------------------------------------------
4

1 回答 1

0

附加:

<profilesXml xmlns="http://maven.apache.org/PROFILES/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
<profiles>
<profile>
...
</profile>
</profiles>
</profilesXml>

它现在工作

于 2013-05-07T12:58:01.730 回答