It's hard to say from your description, but it sounds like you need to
do some serious restructuring of your project. Here's what I think you
need to have:
base-of-project/
pom.xml
myproj-plugin/
pom.xml
src/main/scala code goes here
myproj-base/
pom.xml
src/main/other code goes here
The pom.xml in the base directory would have your <modules> section and
look like this:
<modules>
<module>myproj-plugin</module>
<module>myproj-base</module>
</modules>
This is where the pom.xml files in each sub-directory come into play.
The pom.xml in myproj-base would list "myproj-plugin" as a dependency.
You assign the groupId, artifactId, and version to myproj-plugin in the
top of its pom.xml. Then you can reference that artifact just like you
would any other artifact. The difference is that Maven knows to find it
inside the reactor during the build.
It is far better to bend your expectations to the way that Maven wants
to work than to try to force it into submitting to the way YOU want to
do things. Just learn new habits and you will be far happier letting
Maven do all the neat things it does for you for free.
Nicholas Tung wrote:
> Hi all,
>
> I'm having trouble getting a multi-module project to build. What I want
> to do is simple: build a Scala compiler plugin (jar), and then compile the
> rest of the project using that.
>
> Right now, I have two proxy modules (building things in ../src),
> "myproj-plugin" and "myproj-base". The first builds only the plugin, using
> an assembly to build the jar file -- the output looks fine (though the name
> is a bit long, and I'm not sure how to properly address it). However, when
> "myproj-base" builds, I get "unable to find resource <plugin resource>" [1],
> and it tries downloading "myproj-plugin" from the Scala and Maven
> repositories (ick). I tried specifying the jar name path with "systemPath",
> but no luck.
>
> If possible, I'd like it to be able to
>
> - rebuild all Scala files in "myproj-base" when the plugin changes (to
> make sure the plugin doesn't break anything).
> - build the entire project by typing "mvn compile" in the base directory
> (from scratch).
>
> The full project source is at [2].
>
> Thanks in advance,
> Nicholas
>
> Sorry if this is a duplicate; I have gmail configured to send as
> nt...@ntungbut was subscribed as gatoatigr...@gmail
>
>
>
>
> [1]
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] wrap: 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:
>
> [2]
> http://github.com/gatoatigrado/skalch/commit/cb258d39c0dc796de8f6c1076e05505bb21f854a
>
>