This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Maven target folder is empty when using Eclipse M2 plugin

 
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys : I have a Java project in eclipse that uses Maven (M2) dependency management. I noticed that the Eclipse / M2 plugin (Maven2) has an empty /target folder .... When I noticed this, I started wondering how my project even works if there is nothing in the /target folder !

So to resolve this, I decided to test how a "pure" maven project in eclipse would look.... And so I tried to create a M2 project from a simple archetype, from scratch inside of eclipse, and it ran fine, but the target folder was STILL empty.... I'm quite confused about how the target folder is used by maven in the M2 eclipse plugin... ?
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could you please be more specific on your question?
When you said your project using maven dependency management, doesn't that mean you project is already a maven project?
What are you exactly trying to do?
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well.... My project is a Java project, in the eclipse sense. And I have enabled Maven Dependency Management. I assumed that this would use Maven to also build the project and deploy .jar files to the /target folder. But that did not happen.... So Im confused about how maven, the m2 plugin, and eclipse are interacting.

 
Priyanka Sumanam
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to say that life is never so easy my friend:).....
Doing so would just enable the maven plugin for your project.You need to do the rest by your self.

Basically ensure you project structure is in the below structure as this is the standard structure for a maven project.

my-app
|-- pom.xml
`-- src
|-- main
| |-- java
| | `-- com
| | `-- mycompany
| | `-- app
| | `-- App.java
| `-- resources
| `-- META-INF
| `-- application.properties
`-- test
`-- java
`-- com
`-- mycompany
`-- app
`-- AppTest.java

copy all your java packages into src/main/java.
Then add your dependencies in pom.xml
Then you need to run maven clean install command to build the final jar into target folder.

I would like to suggest you to give a good reading about this .Below is the link.

http://maven.apache.org/guides/getting-started/index.html
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay thanks!
so the eclipse plugin won't automatically accomplish theses tasks?

That seems a little strange..... Given that the u2 menu appears so comprehensive...


In any case that was a very helpfull answer thank a lot.....
 
Saloon Keeper
Posts: 28398
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maven can potentially do an IMMENSE amount of work, including running unit tests, checking code into repositories, building javadocs, installing products into the Maven repository, building a support website, and so forth all in a singleMaven operation. You don't want a minor code change to lock up your machine for half an hour just because a Maven rebuild kicked itself off. And actually, given the fact that Maven projects typically support a wide range of goals, it would be hard to figure out which goal it should choose to run automatically.

It isn't just Maven that has to be run manually by the user. Ant builds work that way, too.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic