I have just realized that I have a problem with multi module projects.
My setup is that I have a maven project using MCP which is a module in
a parent project.
My plugin configuration looks like this:
<plugin>
<groupId>com.google.code.maven-config-processor-plugin</groupId>
<artifactId>maven-config-processor-plugin</artifactId>
<version>1.8-20090807.144550-1</version>
<configuration>
<encoding>ISO-8859-1</encoding>
<transformations>
<transformation>
<type>properties</type>
<input>file:${project.build.directory}/iipax-zip/config/
application.config.inst</input>
<output>modified-files/config/application.config.inst</output>
<config>src/main/assembly/properties-processing.xml</config>
</transformation>
<transformation>
<type>properties</type>
<input>file:${project.build.directory}/iipax-zip/etc/webstart/
application.config.inst.client</input>
<output>modified-files/etc/webstart/
application.config.inst.client</output>
<config>src/main/assembly/client-properties-processing.xml</
config>
</transformation>
</transformations>
</configuration>
<executions>
<execution>
<id>config-process</id>
<phase>process-resources</phase>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
When building the project itself everything works fine. When building
the parent project however I get the error below. Is it a
configuration mistake or is teh plugin itself dependent on the current
directory of the maven process?
Downloading:
http://maven.idainfront.se:9001/proxy/repository/file/C/\svn\idainfront\kam\zip\target/iipax-zip/config/application.config.inst/C-\svn\idainfront\kam\zip\target/iipax-zip/config/application.config.inst.jar
Downloading:
http://repo1.maven.org/maven2/file/C/\svn\idainfront\kam\zip\target/iipax-zip/config/application.config.inst/C-\svn\idainfront\kam\zip\target/iipax-zip/config/application.config.inst.jar
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error during config processing
Embedded error: File not found [src/main/assembly/properties-
processing.xml]
[1] [INFO] File: C:\svn\idainfront\kam\file:C:\svn\idainfront\kam\zip
\target\iipax-zip\config\application.config.inst does not exist.
[2] [INFO] Failed to resolve classpath resource: file:C:\svn\idainfront
\kam\zip\target/iipax-zip/config/application.config.inst from
classloader: org.codehaus.classworlds.RealmClassLoader@11415c8
[3] [INFO] Failed to resolve artifact: file:C:jar:\svn\idainfront\kam
\zip\target/iipax-zip/config/application.config.inst for location:
file:C:\svn\idainfront\kam\zip\target/iipax-zip/config/
application.config.inst
Error:
org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable
to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=file -DartifactId=C -Dversion=
\svn\idainfront\kam\zip\target/iipax-zip/config/
application.config.inst -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file
there:
mvn deploy:deploy-file -DgroupId=file -DartifactId=C -Dversion=\svn
\idainfront\kam\zip\target/iipax-zip/config/application.config.inst -
Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
file:C:jar:\svn\idainfront\kam\zip\target/iipax-zip/config/
application.config.inst
from the specified remote repositories:
central (
http://repo1.maven.org/maven2),
idainfront (
http://maven.idainfront.se:9001/proxy/repository)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve
(DefaultArtifactResolver.java:212)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve
(DefaultArtifactResolver.java:74)
at org.apache.maven.shared.io.location.ArtifactLocatorStrategy.resolve
(ArtifactLocatorStrategy.java:133)
at org.apache.maven.shared.io.location.Locator.resolve(Locator.java:
81)
at com.google.code.configprocessor.maven.MavenFileResolver.resolve
(MavenFileResolver.java:46)
at com.google.code.configprocessor.ConfigProcessor.execute
(ConfigProcessor.java:74)
at com.google.code.configprocessor.ConfigProcessorMojo.execute
(ConfigProcessorMojo.java:197)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:558)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:478)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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.wagon.ResourceDoesNotExistException:
Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact
(DefaultWagonManager.java:331)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve
(DefaultArtifactResolver.java:200)
... 24 more
[4] [INFO] File: C:\svn\idainfront\kam\src\main\assembly\properties-
processing.xml does not exist.
[5] [INFO] Failed to resolve classpath resource: src/main/assembly/
properties-processing.xml from classloader:
org.codehaus.classworlds.RealmClassLoader@11415c8
[6] [INFO] Invalid artifact specification: 'src/main/assembly/
properties-processing.xml'. Must contain at least three fields,
separated by ':'.
[7] [INFO] Building URL from location: src/main/assembly/properties-
processing.xml
Error:
java.net.MalformedURLException: no protocol: src/main/assembly/
properties-processing.xml
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.maven.shared.io.location.URLLocatorStrategy.resolve
(URLLocatorStrategy.java:54)
at org.apache.maven.shared.io.location.Locator.resolve(Locator.java:
81)
at com.google.code.configprocessor.maven.MavenFileResolver.resolve
(MavenFileResolver.java:46)
at com.google.code.configprocessor.ConfigProcessor.execute
(ConfigProcessor.java:75)
at com.google.code.configprocessor.ConfigProcessorMojo.execute
(ConfigProcessorMojo.java:197)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:558)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:478)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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)