You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paul Rivera <pa...@gmail.com> on 2012/04/03 05:31:00 UTC

installing non-maven jars before compile

Hi,

I'm trying to install some non-maven files before I compile my project.
Here's a snippet of my pom.xml:

[code]
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.3.1</version>
                <executions>
                    <execution>
                        <id>install-mallet</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>install-file</goal>
                        </goals>
                        <configuration>
                            <file>${project.basedir}/lib/somejar.jar</file>
                            <groupId>mygroup</groupId>
                            <artifactId>somejar</artifactId>
                            <version>1</version>
                            <packaging>jar</packaging>
                            <createChecksum>true</createChecksum>
                            <generatePom>true</generatePom>
                        </configuration>
                    </execution>
                    ...
[/code]


Now, this works fine if I call:
  mvn validate

But if I call:
  mvn compile

These jars don't get installed.  I thought that if I call "mvn compile",
all phases before it will also get called (e.g. validate, initialize,
generate-sources, process-sources, generate-resources, process-resources).
Why is this not happenning?

Best Regards,
Paul

Re: installing non-maven jars before compile

Posted by Wayne Fay <wa...@gmail.com>.
> That's strange.
> What version of maven are you running?  I'm using 3.0.4 on windows 7.

As posted in the gist:
C:\dev\work\isaf\excel-import>mvn -X compile
Apache Maven 3.0.4 (r1232337; 2012-01-17 02:44:56-0600)
Maven home: C:\dev\apache-maven\apache-maven-3.0.4\bin\..
Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
Java home: C:\dev\java\jdk1.6.0_31\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows vista", version: "6.0", arch: "x86", family: "windows"

Yes, that says Vista. This test was done on a VM. ;-)

Wayne

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


Re: installing non-maven jars before compile

Posted by Wayne Fay <wa...@gmail.com>.
> Anyone know why this is so broken when it comes to Android porting!!

Again, you should ask your Maven + Android questions on the following list:
http://groups.google.com/group/maven-android-developers

And you will probably find this plugin helpful:
http://code.google.com/p/maven-android-plugin/

Wayne

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


Re: installing non-maven jars before compile

Posted by mike digioia <mp...@gmail.com>.
I have similar problem, except the jar gets installed in its own separate
directory from the local repository - .m2/repository/com/x/y/z/ name.jar
and name.pom, since I asked to create a pom. But this jar never gets
references in the compile since the source file that uses it has all
undefined references for the classes inside the jar, as if it never was
used. I can not add anything to my main pom.xml to include the dependency
of this new jar, since all attempts get an error message "using the wrong
pom for this project" Like it knows this dependency is not allowed for some
reason.

The new Jar I added is from my eclipse project that is to run on my android
phone.

So now I am going to attempt to rebuilt everything over again and follow
the instructions, in hopes that this will correct it.

Anyone know why this is so broken when it comes to Android porting!!

On Tue, Apr 3, 2012 at 4:15 PM, Paul Rivera <pa...@gmail.com> wrote:

> Hi Wayne,
>
> That's strange.
> What version of maven are you running?  I'm using 3.0.4 on windows 7.
>
> Best Regards,
> Paul
>
> On Wed, Apr 4, 2012 at 2:40 AM, Wayne Fay <wa...@gmail.com> wrote:
>
> > > These jars don't get installed.  I thought that if I call "mvn
> compile",
> > > all phases before it will also get called (e.g. validate, initialize,
> > > generate-sources, process-sources, generate-resources,
> > process-resources).
> > > Why is this not happening?
> >
> > Works for me.
> >
> > I just copied and pasted your config into one of my own pom.xml files,
> > then put ojdbc6.jar in a lib subdir and ran "mvn -X compile":
> > https://gist.github.com/2293464
> >
> > Wayne
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: installing non-maven jars before compile

Posted by Paul Rivera <pa...@gmail.com>.
Hi Wayne,

That's strange.
What version of maven are you running?  I'm using 3.0.4 on windows 7.

Best Regards,
Paul

On Wed, Apr 4, 2012 at 2:40 AM, Wayne Fay <wa...@gmail.com> wrote:

> > These jars don't get installed.  I thought that if I call "mvn compile",
> > all phases before it will also get called (e.g. validate, initialize,
> > generate-sources, process-sources, generate-resources,
> process-resources).
> > Why is this not happening?
>
> Works for me.
>
> I just copied and pasted your config into one of my own pom.xml files,
> then put ojdbc6.jar in a lib subdir and ran "mvn -X compile":
> https://gist.github.com/2293464
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: installing non-maven jars before compile

Posted by Wayne Fay <wa...@gmail.com>.
> These jars don't get installed.  I thought that if I call "mvn compile",
> all phases before it will also get called (e.g. validate, initialize,
> generate-sources, process-sources, generate-resources, process-resources).
> Why is this not happening?

Works for me.

I just copied and pasted your config into one of my own pom.xml files,
then put ojdbc6.jar in a lib subdir and ran "mvn -X compile":
https://gist.github.com/2293464

Wayne

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