You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by youhaodeyi <yo...@gmail.com> on 2008/02/20 02:37:09 UTC

Does Maven dependency only work with jar?

I have some *.class files in a directory. I know I can make them into a jar
file and add it to the dependency of Maven, but I don't want to package
them. How can I set the dependency in Maven to add this directory to
classpath?
-- 
View this message in context: http://www.nabble.com/Does-Maven-dependency-only-work-with-jar--tp15580501s177p15580501.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Does Maven dependency only work with jar?

Posted by "simon.kitching@chello.at" <si...@chello.at>.
Or use maven-antrun-plugin to copy the .class files into target/classes.

The maven-antrun-plugin is always there to do those things that maven
doesn't want to do.

But in this case, just following the maven conventions *is* probably the
right thing.

Regards, Simon

Stephen Connolly schrieb:
> eh! technically he _could_ add a packaging of type class and have one (1)
> maven project for each class file ;-) [i.e. the five class files that he
> does not want to jar up would each have their own maven project, and hope
> that they don't reference each other in a circular fashion or he's screwed]
>
> but in fairness, who'd want to go to all that trouble, writing a
> class-maven-plugin...
>
> Of course at that point he'd then hit how to get those classes into the java
> class path for the compiler etc plugins... so then he's writing a new
> compiler and surefire-type plugin that understands class dependencies...
>
> I'd give an estimate of about 12-15 months to get all that working...
>
> On the other hand, if he packages them up in a jar, that's maybe 12-15
> seconds to get that working...
>
> So to summarise:
>
> fight the system -> months
> use a jar -> seconds
>
> It's his choice!
>
> ;-)
>
> -Stephen
> On Feb 20, 2008 5:59 AM, Wayne Fay <wa...@gmail.com> wrote:
>
>   
>> You can't. Don't fight the system and you'll be a generally happier
>> person. Package the class files into a Jar.
>>
>> Wayne
>>
>> On Feb 19, 2008 7:37 PM, youhaodeyi <yo...@gmail.com> wrote:
>>     
>>> I have some *.class files in a directory. I know I can make them into a
>>>       
>> jar
>>     
>>> file and add it to the dependency of Maven, but I don't want to package
>>> them. How can I set the dependency in Maven to add this directory to
>>> classpath?
>>> --
>>> View this message in context:
>>>       
>> http://www.nabble.com/Does-Maven-dependency-only-work-with-jar--tp15580501s177p15580501.html
>>     
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>     
>
>   


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


Re: Does Maven dependency only work with jar?

Posted by Stephen Connolly <st...@gmail.com>.
eh! technically he _could_ add a packaging of type class and have one (1)
maven project for each class file ;-) [i.e. the five class files that he
does not want to jar up would each have their own maven project, and hope
that they don't reference each other in a circular fashion or he's screwed]

but in fairness, who'd want to go to all that trouble, writing a
class-maven-plugin...

Of course at that point he'd then hit how to get those classes into the java
class path for the compiler etc plugins... so then he's writing a new
compiler and surefire-type plugin that understands class dependencies...

I'd give an estimate of about 12-15 months to get all that working...

On the other hand, if he packages them up in a jar, that's maybe 12-15
seconds to get that working...

So to summarise:

fight the system -> months
use a jar -> seconds

It's his choice!

;-)

-Stephen
On Feb 20, 2008 5:59 AM, Wayne Fay <wa...@gmail.com> wrote:

> You can't. Don't fight the system and you'll be a generally happier
> person. Package the class files into a Jar.
>
> Wayne
>
> On Feb 19, 2008 7:37 PM, youhaodeyi <yo...@gmail.com> wrote:
> >
> > I have some *.class files in a directory. I know I can make them into a
> jar
> > file and add it to the dependency of Maven, but I don't want to package
> > them. How can I set the dependency in Maven to add this directory to
> > classpath?
> > --
> > View this message in context:
> http://www.nabble.com/Does-Maven-dependency-only-work-with-jar--tp15580501s177p15580501.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Does Maven dependency only work with jar?

Posted by Wayne Fay <wa...@gmail.com>.
You can't. Don't fight the system and you'll be a generally happier
person. Package the class files into a Jar.

Wayne

On Feb 19, 2008 7:37 PM, youhaodeyi <yo...@gmail.com> wrote:
>
> I have some *.class files in a directory. I know I can make them into a jar
> file and add it to the dependency of Maven, but I don't want to package
> them. How can I set the dependency in Maven to add this directory to
> classpath?
> --
> View this message in context: http://www.nabble.com/Does-Maven-dependency-only-work-with-jar--tp15580501s177p15580501.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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