Now source code is ready, how can I create it with Maven?
Assume that the source file hw.java
I have gone for a while, to set up the directory in a certain way for all the solutions is required.
But to do what I want, keep hw.java
in the current directory (.
), and then:
vi pom.xml ... mkdir build CD build meen ...
Can I have that kind of freedom with Maven?
Suppose source file
hw.java
There is a bad choice for the class file name in Java :)
I've gone for a while, setting up the directory for all the solutions is required.
Not really sure but "warmly suggested" (depending on Mewen conventions - being one of them - and if you follow Mewen's conventions according to DEC To be highly recommended to use the Ide, less work, less troubles).
But what I want to do is keep hw.java in the current directory (.) (...)
I think you can Need to store at least one directory pom.xml
to Java sources.
Can I have Maven with that kind of freedom?
Maven is flexible and the default is configurable, but you should actually use conventions (or any other tool compared to Maven). I suggest creating a project using the original for a simple project:
mvn archetype: generated - B-DgroupId = com.stackoverflow \ -DartifactId = Q2841166 \ -Dversion = 1.0-SNAPSHOT
Then place your source under src / main / java
(in the appropriate package) and run mvn install
.
Update: It seems that you are not able to understand what I am saying or you just do not want to hear in that case, Now, because changing these mistakes is not recommended, because Maven does not encourage doing so because it's a bad idea if you are not working from a legacy project Do not expect to find "tutorial" about this because it is worthless work if you do not have to do this because it will have more trouble than profit. Repeat this to me: The one you are asking is a "shoot yourself in the foot" and it's just ridiculous. The last thing: if Maven does not work, you do not work, do not use Maven, I can give you the best advice. build Feel free to modify the element in documented (as I said, default is not ):
& lt; Project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: SchemaLocation = "http: // Maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> ... & lt; Build & gt; & Lt; SourceDirectory & gt; $ {Basedir} / src / main / Java & lt; / SourceDirectory & gt; & Lt; ScriptSourceDirectory & gt; $ {Basedir} / src / main / scripts & lt; / ScriptSourceDirectory & gt; & Lt; TestSourceDirectory & gt; $ {Basedir} / src / test / Java & lt; / TestSourceDirectory & gt; & Lt; OutputDirectory & gt; $ {Basedir} / target / sections & lt; / OutputDirectory & gt; & Lt; TestOutputDirectory & gt; $ {Basedir} / target / test squares & lt; / TestOutputDirectory & gt; ... & lt; / Build & gt; & Lt; / Project & gt;
Comments
Post a Comment