You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Licinio Fernández Maurelo <li...@gmail.com> on 2010/01/28 15:21:56 UTC

Mavenizing solr webapp

Hi everybody. I'm trying to build apache-solr *webapp* (not the whole
project) using maven . Also want to reuse the build.xml ant file.

The directory structure is:

+build
+client
+contrib
.....
+src
 +webapp/src --webapp code
+dist --generated artifacts by the ant script
      --must be copied to the webapp WEB-INF/lib
      --some of them are also needed for webapp code compilation

I've successfully called the ant target that compiles and populates the dist
dir.

What I need is to:

1) Include some of the jars that reside in the dist directory to compile the
webapp code.

2) Package some of the jars in the war artifact maven builds.

Any help would be much appreciated


-- 
Lici
~Java Developer~

Re: Mavenizing solr webapp

Posted by Licinio Fernández Maurelo <li...@gmail.com>.
Thanks for your replies Antonio, i'll take a better approach and refuse the
reuse of ant build reuse.

2010/1/28 Antonio Petrelli <an...@gmail.com>

> 2010/1/28 Licinio Fernández Maurelo <li...@gmail.com>:
> > *Step one*: pom calls the ant-target that generates the artifacts
> >...
> > Step two: maven compiles de webapp including in the classpath some of the
> > previous' phase generated jar's.
>
> Notice that I don't like this approach, since I am a purist.
> Anyway, I suggest you to compile only once your code altogether
> (libraries and webapp-related code) and then package the jars where
> they belong.
> It's almost impossible to compile, in maven, putting a local library
> in the classpath of the compiler.
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Lici
~Java Developer~

Re: Mavenizing solr webapp

Posted by Antonio Petrelli <an...@gmail.com>.
2010/1/28 Licinio Fernández Maurelo <li...@gmail.com>:
> *Step one*: pom calls the ant-target that generates the artifacts
>...
> Step two: maven compiles de webapp including in the classpath some of the
> previous' phase generated jar's.

Notice that I don't like this approach, since I am a purist.
Anyway, I suggest you to compile only once your code altogether
(libraries and webapp-related code) and then package the jars where
they belong.
It's almost impossible to compile, in maven, putting a local library
in the classpath of the compiler.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Mavenizing solr webapp

Posted by Licinio Fernández Maurelo <li...@gmail.com>.
You're right Antonio, but as we modified code the public solr artifacts
don't work for us. Let me explain the sequence i want to implement in the
build process.

*Step one*: pom calls the ant-target that generates the artifacts

                  <execution>
                        <id>build.xml dist target</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <ant antfile="build.xml">
                                    <property name="build.compiler"
value="extJavac"/>
                                <target name="dist" />
                                </ant>
                            </tasks>
                        </configuration>
                    </execution>

Step two: maven compiles de webapp including in the classpath some of the
previous' phase generated jar's.

(my question)

Step three: Package the war file with the compiled webapp code, static
resources and some of the libraries generated in phase 1.


Step four: Install the resultant artifact into local repository






2010/1/28 Antonio Petrelli <an...@gmail.com>

> 2010/1/28 Licinio Fernández Maurelo <li...@gmail.com>:
> > As we are changing part of the code we just want to integrate the
> > solr-webapp into our projects. As i said, don't want to mavenize the
> whole
> > project.
>
> Wait a Minute, I see that Solr packages are already available at the
> main repository, with the exception of the War itself...
> IMHO you need to put only the correct dependencies. Or does the
> build.xml do strange things in the final package?
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Lici
~Java Developer~

Re: Mavenizing solr webapp

Posted by Antonio Petrelli <an...@gmail.com>.
2010/1/28 Licinio Fernández Maurelo <li...@gmail.com>:
> As we are changing part of the code we just want to integrate the
> solr-webapp into our projects. As i said, don't want to mavenize the whole
> project.

Wait a Minute, I see that Solr packages are already available at the
main repository, with the exception of the War itself...
IMHO you need to put only the correct dependencies. Or does the
build.xml do strange things in the final package?

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Mavenizing solr webapp

Posted by Licinio Fernández Maurelo <li...@gmail.com>.
As we are changing part of the code we just want to integrate the
solr-webapp into our projects. As i said, don't want to mavenize the whole
project.

2010/1/28 Antonio Petrelli <an...@gmail.com>

> 2010/1/28 Licinio Fernández Maurelo <li...@gmail.com>:
> > Hi everybody. I'm trying to build apache-solr *webapp* (not the whole
> > project) using maven .
>
> I think this is the big mistake: if you mavenize a project, then all
> of the dependencies should be available, at least, as maven artifacts.
> That means, usually, that all the dependencies must be mavenized for
> good. If you don't do it, your POM will be simply a wrapper to Ant
> targets.
> Is there a reason not to mavenize the whole project?
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Lici
~Java Developer~

Re: Mavenizing solr webapp

Posted by Antonio Petrelli <an...@gmail.com>.
2010/1/28 Licinio Fernández Maurelo <li...@gmail.com>:
> Hi everybody. I'm trying to build apache-solr *webapp* (not the whole
> project) using maven .

I think this is the big mistake: if you mavenize a project, then all
of the dependencies should be available, at least, as maven artifacts.
That means, usually, that all the dependencies must be mavenized for
good. If you don't do it, your POM will be simply a wrapper to Ant
targets.
Is there a reason not to mavenize the whole project?

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org