MyEclipse: MyEclipse 8.5 And Maven Configuration
kt22 - Jul 14, 2010 - 08:57 PM
Post subject: MyEclipse 8.5 And Maven Configuration
What is the best practice for importing an existing Maven project (of type war) into MyEclipse 8.5 with goals of developing with Wicket, auto building and hot deploying with debugging enabled?
Currently I do:
1) File, Import, Maven4MyEclipse, Existing Maven Projects, choose pom.xml directory, finish.
- I get an error message: An internal error occurred during: "Importing Maven projects".
Invalid thread access, although I just hit OK and continue.
2) I right click on the project, select Run As, Maven package (this creates the necessary target/myapp/ directory in the next step
3) I right click on the maven war project and select MyEclipse, Add Web Project Capabilities...
- select /target/myapp for the web root dir, adjust my web context root, uncheck create web.xml, check j2ee 5.0 and uncheck add j2ee lib to buildpath (its in the maven dependencies)
- click finish and say Yes to reset output folders
4) right click on the project, select properties, MyEclipse, Web and see that my changes I just made for web root and web context did NOT take effect, this is a bug. I reset my web root and web context as in step 3 and hit OK.
5) right click on my project, select properties, Java Build Path, Source tab, click on the entry for src/main/resources and remove the entry for "excluded: **". Click Add Folder and add src/main/webapp. Click on Allow output folders for source folders. Click on Output folder for src/main/webapp and change it to target/myapp. Click OK but an error message says "Cannot nest 'myapp-web/target/myapp/WEB-INF/lib/some.random.jar' inside of output folder... to get rid of this message I click on the project properties, Maven4MyEclipse, select Update Project Configuration. Go back and do the above steps. So now I have 3 folders, src/main/java, src/main/resources and src/main/webapp in the Source tab, with no includes or excludes set, with the check box set for allow output folders for source folders, with java and resources dir set for the output dir of myapp-web/target/myapp/WEB-INF/classes, the webapp dir output folder set to myapp-web/target/myapp and the default output dir set to myapp-web/target/myapp/WEB-INF/classes just to be sure.
6) Add a bogus file at src/main/webapp/WEB-INF/classes/dumby.txt to force MyEclipse to create the WEB-INF/classes dir in the output folder and actually output the .classes and resources correctly - otherwise nothing is outputted.
7) create a deployment for for my app container
8) clean the project and let it auto build.
The problems I have, besides the fact that MyEclipse has bugs and the maven integration is not straight forward, is that src/main/resources is not filtered for the native MyEclipse Java Builder, ie the output to myapp-web/target/myapp/WEB-INF/classes. The Maven Project Builder that is enabled compiles and processes resources to target/classes - which doesn't do me any good if I am trying to get MyEclipse to build an exploded war dir and it is already compiling the java files anyway (why compile twice? once for the Maven Builder and once for the Java Builder). Additionally MyEclipse will not resource filter webresources that would occur during Maven's package phase, so your web.xml is not filtered. Additionally, even though no filters are set for the output directory the Wicket .html files found in the src/main/java dir do not get outputted to the output folder. How do you output the .html files to the output folder? What is the purpose of the Maven Project Builder? Why not just exec the maven goals as needed when you want to invoke maven? If the Java Builder is already compiling the classes and I cannot utilize the filtered resources in target/classes without invoking the package phase to move them to target/myapp/WEB-INF/classes, then why enable the Maven Project Builder?
So although MyEclipse can 'integrate' w/ Maven projects to some extent, it is not without problems, intuitive or seemless. IntellIj works extremely well with Maven in comparison.
Is there a better best practice for importing Maven projects with goals of developing with Wicket, auto building and hot deploying with debugging enabled? Is this what others are doing?
tsmets - Sep 09, 2010 - 12:51 PM
Post subject: RE: MyEclipse 8.5 And Maven Configuration
No update on this so far .... ?
Integration Maven & MyEclipse seem broken ....
Directory structure is not consistent + I get this now
9/9/10 12:04:30 PM CEST: Build error for /CleanSystemsWeb/pom.xml; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources (default-resources) on project CleanSystemWeb: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.1 or one of its dependencies could not be resolved: The repository system is offline and the requested artifact is not locally available at /Users/tsmets/.m2/repository/org/apache/maven/wagon/wagon-file/1.0-beta-2/wagon-file-1.0-beta-2.jar
from the specified remote repositories:
jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public-jboss/, releases=true, snapshots=true),
central (http://repo1.maven.org/maven2, releases=true, snapshots=false),
plexus.snapshots (http://oss.repository.sonatype.org/content/repositories/plexus-snapshots, releases=false, snapshots=true),
apache.snapshots (http://repository.apache.org/snapshots, releases=false, snapshots=true)
Path to dependency:
All times are GMT - 6 Hours
Powered by PNphpBB2
© 2003-2004 The PNphpBB GroupCredits