java - Storing archetypes with maven in different ways -
to hang of maven. in downloaded commons-cli. uncompiled apache cli helper.
i created new maven project , yanked uncompiled code in it. so:
mvn archetype:generate -darchetypeartifactid=maven-archetype- quickstart -dinteractivemode=false
this created:
commons-cli/ src/ main/ java/ cli/ *.java <- java code.
now run:
mvn archetype:create-from-project
this creates:
generated-sources/ archetype/ src/ main/ test/ target/ pom.xml
in pom.xml:
<groupid>com.company.app</groupid> <artifactid>test-archetype</artifactid> <version>1.0-snapshot</version> <packaging>maven-archetype</packaging> <name>test-archetype</name>
now:
cd target/generated-sources/archetype/
and
mvn clean install
now hava jar in .m2/ folder , can not use dependecy. becuase code uncompiled.
my quistion is:
how can have .jar compiled , usable code (.class)added local repo? , use without java code.
how can have java code added repo, maven-archetype-quickstart ?
thanks bunch.
your question somehow confusing, try answer best can:
archetypes blueprints projects: use them create new project, not put source code inside them.
you create compiled jar calling mvn clean install
. writes jar compiled classes local repository. if build such jar, can add side artifacts "sources" , "javadoc". these put local repository.
Comments
Post a Comment